Files
UnrealEngineUWP/Engine/Plugins/Experimental/Mutable/Source/MutableTools/Public/MuT/NodeScalarArithmeticOperation.h
jordi rovira cca6a36b3f [mutable] Optimize mesh clip versus switching of clipping mesh.
Cleanup usage of most of STL from mutable runtime. Exception is string for now.
Cleanup a lot of unused code like reference implementations, node cloning boilerplate, etc.
#preflight 63441fcf7045f13c96b43bcf
[REVIEW] [at]max.garcia
[FYI] [at]alexei.lebedev
[FYI] genis.sole

[CL 22454093 by jordi rovira in ue5-main branch]
2022-10-11 05:14:05 -04:00

102 lines
2.7 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "MuR/Ptr.h"
#include "MuR/RefCounted.h"
#include "MuT/Node.h"
#include "MuT/NodeScalar.h"
namespace mu
{
// Forward definitions
class NodeScalarArithmeticOperation;
typedef Ptr<NodeScalarArithmeticOperation> NodeScalarArithmeticOperationPtr;
typedef Ptr<const NodeScalarArithmeticOperation> NodeScalarArithmeticOperationPtrConst;
//! Perform an arithmetic operation between two scalars.
//! \ingroup model
class MUTABLETOOLS_API NodeScalarArithmeticOperation : public NodeScalar
{
public:
//-----------------------------------------------------------------------------------------
// Life cycle
//-----------------------------------------------------------------------------------------
NodeScalarArithmeticOperation();
void SerialiseWrapper(OutputArchive& arch) const override;
static void Serialise( const NodeScalarArithmeticOperation* pNode, OutputArchive& arch );
static NodeScalarArithmeticOperationPtr StaticUnserialise( InputArchive& arch );
//-----------------------------------------------------------------------------------------
// Node Interface
//-----------------------------------------------------------------------------------------
const NODE_TYPE* GetType() const override;
static const NODE_TYPE* GetStaticType();
int GetInputCount() const override;
Node* GetInputNode( int i ) const override;
void SetInputNode( int i, NodePtr pNode ) override;
//-----------------------------------------------------------------------------------------
// Own Interface
//-----------------------------------------------------------------------------------------
//! Possible arithmetic operations
typedef enum
{
AO_ADD = 0,
AO_SUBTRACT,
AO_MULTIPLY,
AO_DIVIDE,
_AO_COUNT
} OPERATION;
static const char* s_opTypeName[ _AO_COUNT ];
//! Get child selection type
OPERATION GetOperation() const;
//! Set the child selection type
void SetOperation(OPERATION);
//! Get the first operand
NodeScalarPtr GetA() const;
void SetA(NodeScalarPtr);
// Get the second operand
NodeScalarPtr GetB() const;
void SetB(NodeScalarPtr);
//-----------------------------------------------------------------------------------------
// Interface pattern
//-----------------------------------------------------------------------------------------
class Private;
Private* GetPrivate() const;
Node::Private* GetBasePrivate() const override;
protected:
//! Forbidden. Manage with the Ptr<> template.
~NodeScalarArithmeticOperation();
private:
Private* m_pD;
};
}