OpenLexocad  27.1
Globals.h File Reference
#include <sstream>
#include <string>

Go to the source code of this file.

Classes

struct  OpenLxApp::Version
 

Namespaces

 OpenLxApp
 

Macros

#define M_PI   3.1415926535897932384626433832795029
 
#define END_OF_LOOP   -2
 
#define END_OF_FACE   -1
 
#define FORWARD_DECL(x, y)
 
#define PLUGIN_HEADER(_class_)
 
#define PLUGIN_SOURCE(_class_)   PLUGINDECL App::Plugin* createPlugin(App::PluginManager& mgr) { return (App::Plugin*)new _class_(); }
 
#define OBJECT_HEADER(_class_, _type_)
 If the external application/plug-in developer derives from a Doc.Object class to extend the functionality of Lexocad there must be an OpenLexocad Proxy class for the derived class to be able to work with the OpenLexocad API. These macros provide the automatic declaration and implementation of the Proxy classes. More...
 
#define PROXY_HEADER_ABSTRACT(_openlexocadclass_, _corelexocadclass_, _type_)
 
#define PROXY_HEADER(_openlexocadclass_, _corelexocadclass_, _type_)
 
#define PROXY_SOURCE_ABSTRACT(_openlexocadclass_, _corelexocadclass_, _type_)
 
#define PROXY_SOURCE(_openlexocadclass_, _corelexocadclass_, _type_)
 
#define PROXY_SOURCE_CUSTOM_CREATE(_openlexocadclass_, _corelexocadclass_, _type_)   PROXY_SOURCE_ABSTRACT(_openlexocadclass_, _corelexocadclass_, _type_)
 
#define EXT_FORWARD_DECL(_class_)   class _class_##_Proxy;
 
#define EXT_DECLARE_PROXYOBJECT(_class_, _parentclass_)
 
#define EXT_OBJECT_SOURCE(_class_, _parent_)
 
#define EXT_FORWARD_DECL(_class_)   class _class_##_Proxy;
 
#define DECL_PROPERTY(_class_, _name_, _type_)
 DECL_PROPERTY and DEFINE_PROPERTY are macros used for mapping between the properties of Lexocad objects and their corresponding getter setter in OpenLexocad. More...
 
#define DEFINE_PROPERTY(_class_, _name_, _propname_, _type_)
 

Enumerations

enum  OpenLxApp::ErrorCode {
  OpenLxApp::ErrorCode::NoError = 0, OpenLxApp::ErrorCode::UnknownError = 1, OpenLxApp::ErrorCode::InvalidArguments = 2, OpenLxApp::ErrorCode::ResultingGeometryIsInvalid = 3,
  OpenLxApp::ErrorCode::InsufficientArraySize = 4
}
 

Variables

 PYTHON
 
 CSHARP
 
 X
 
 Y
 
 Z
 
 NX
 
 NY
 
 NZ
 
 AXO_LEFT
 
 AXO_BACK_LEFT
 
 NewDocument
 
 CloseDocument
 
 SetActiveDocument
 
 RecomputeFinished
 
 FileOpened
 
 NewFile
 
 BeforeSave
 
 AddSelection
 
 RemoveSelection
 
 ClearSelection
 
 UpdateSelection
 
 RemoveActivePoint
 
 SetActivePoint
 

Macro Definition Documentation

◆ DECL_PROPERTY

#define DECL_PROPERTY (   _class_,
  _name_,
  _type_ 
)
Value:
public: \
_type_ get##_name_() const; \
\
public: \
void set##_name_(const _type_& aValue);

DECL_PROPERTY and DEFINE_PROPERTY are macros used for mapping between the properties of Lexocad objects and their corresponding getter setter in OpenLexocad.

Since
24.0
Author
HPK
Date
2017-01-26

◆ DEFINE_PROPERTY

#define DEFINE_PROPERTY (   _class_,
  _name_,
  _propname_,
  _type_ 
)
Value:
_type_ _class_::get##_name_() const { return __getCasted__()->_propname_.getValue(); } \
void _class_::set##_name_(const _type_& aValue) { __getCasted__()->_propname_.setValue(aValue); }
constexpr get_t< Type... > get
Variable template for lists of observed components.
Definition: entt.hpp:6068

◆ END_OF_FACE

#define END_OF_FACE   -1

◆ END_OF_LOOP

#define END_OF_LOOP   -2

◆ EXT_DECLARE_PROXYOBJECT

#define EXT_DECLARE_PROXYOBJECT (   _class_,
  _parentclass_ 
)
Value:
class _class_##_Proxy : public _parentclass_ \
{ \
OBJECT_HEADER(_class_##_Proxy, IFC_ENTITY_UNDEFINED) \
public: \
_class_##_Proxy(_class_* aObject) : _parentclass_(aObject) { assert(aObject); } \
virtual ~_class_##_Proxy(void) {} \
\
protected: \
_class_##_Proxy() {} \
}; \
DECLARE_OBJECT_FACTORY(_class_##_Factory, _class_, IFC_ENTITY_UNDEFINED);

◆ EXT_FORWARD_DECL [1/2]

#define EXT_FORWARD_DECL (   _class_)    class _class_##_Proxy;

◆ EXT_FORWARD_DECL [2/2]

#define EXT_FORWARD_DECL (   _class_)    class _class_##_Proxy;

◆ EXT_OBJECT_SOURCE

#define EXT_OBJECT_SOURCE (   _class_,
  _parent_ 
)
Value:
TYPESYSTEM_SOURCE(_class_, _parent_) \
LX_NODE_SOURCE(_class_, _parent_)
#define TYPESYSTEM_SOURCE(_class_, _parentclass_)
define to implement a subclass of Base::BaseClass
Definition: Base.h:65

◆ FORWARD_DECL

#define FORWARD_DECL (   x,
 
)
Value:
namespace x \
{ \
class y; \
}

◆ M_PI

#define M_PI   3.1415926535897932384626433832795029

◆ OBJECT_HEADER

#define OBJECT_HEADER (   _class_,
  _type_ 
)
Value:
public: \
static LxIfc4::LxIfc4EntityEnum getEntityType_Static() { return LxIfc4::_type_; } \
\
explicit _class_(std::shared_ptr<_class_> other) { _coreObj = other->_coreObj; } \
_class_& operator=(std::shared_ptr<_class_> other) \
{ \
_coreObj = other->_coreObj; \
return *this; \
} \
friend bool operator==(std::shared_ptr<_class_> x, std::shared_ptr<_class_> y) { return x->_coreObj == y->_coreObj; } \
friend bool operator!=(std::shared_ptr<_class_> x, std::shared_ptr<_class_> y) { return !(x == y); } \
friend bool operator<(std::shared_ptr<_class_> x, std::shared_ptr<_class_> y) { return x->_coreObj < y->_coreObj; } \
friend bool operator>(std::shared_ptr<_class_> x, std::shared_ptr<_class_> y) { return y < x; } \
friend bool operator<=(std::shared_ptr<_class_> x, std::shared_ptr<_class_> y) { return !(x > y); } \
friend bool operator>=(std::shared_ptr<_class_> x, std::shared_ptr<_class_> y) { return !(x < y); } \
bool isEqual(std::shared_ptr<_class_> other) const /*For Python*/ { return (_coreObj == other->_coreObj); }
constexpr bool operator!=(const basic_hashed_string< Char > &lhs, const basic_hashed_string< Char > &rhs) ENTT_NOEXCEPT
Compares two hashed strings.
Definition: entt.hpp:570

If the external application/plug-in developer derives from a Doc.Object class to extend the functionality of Lexocad there must be an OpenLexocad Proxy class for the derived class to be able to work with the OpenLexocad API. These macros provide the automatic declaration and implementation of the Proxy classes.

Since
24.0
Author
HPK
Date
2017-01-10

◆ PLUGIN_HEADER

#define PLUGIN_HEADER (   _class_)
Value:
public: \
std::string getName() override { return #_class_; }

◆ PLUGIN_SOURCE

#define PLUGIN_SOURCE (   _class_)    PLUGINDECL App::Plugin* createPlugin(App::PluginManager& mgr) { return (App::Plugin*)new _class_(); }

◆ PROXY_HEADER

#define PROXY_HEADER (   _openlexocadclass_,
  _corelexocadclass_,
  _type_ 
)
Value:
PROXY_HEADER_ABSTRACT(_openlexocadclass_, _corelexocadclass_, _type_) \
public: \
_openlexocadclass_(std::shared_ptr<OpenLxApp::Document> aDoc); \
\
public: \
static std::shared_ptr<_openlexocadclass_> createIn(std::shared_ptr<OpenLxApp::Document> aDoc); \
\
public: \
static std::shared_ptr<_openlexocadclass_> createFrom(_corelexocadclass_* aObj);
#define PROXY_HEADER_ABSTRACT(_openlexocadclass_, _corelexocadclass_, _type_)
Definition: Globals.h:137

◆ PROXY_HEADER_ABSTRACT

#define PROXY_HEADER_ABSTRACT (   _openlexocadclass_,
  _corelexocadclass_,
  _type_ 
)
Value:
OBJECT_HEADER(_openlexocadclass_, _type_) \
public: \
_openlexocadclass_(_corelexocadclass_* aObj); \
\
public: \
_corelexocadclass_* __getCasted__() const;
#define OBJECT_HEADER(_class_, _type_)
If the external application/plug-in developer derives from a Doc.Object class to extend the functiona...
Definition: Globals.h:119

◆ PROXY_SOURCE

#define PROXY_SOURCE (   _openlexocadclass_,
  _corelexocadclass_,
  _type_ 
)
Value:
PROXY_SOURCE_ABSTRACT(_openlexocadclass_, _corelexocadclass_, _type_) \
_openlexocadclass_::_openlexocadclass_(std::shared_ptr<OpenLxApp::Document> aDoc) \
/* TODO: ADD CALL TO SUPER CLASS */ { _coreObj = aDoc->__getInternalDoc__()->createObject<_corelexocadclass_>(); } \
std::shared_ptr<_openlexocadclass_> _openlexocadclass_::createIn(std::shared_ptr<OpenLxApp::Document> aDoc) \
{ \
auto obj = aDoc->__getInternalDoc__()->createObject<_corelexocadclass_>(); \
if(obj) return std::make_shared<_openlexocadclass_>(obj); \
else return nullptr; \
} \
std::shared_ptr<_openlexocadclass_> _openlexocadclass_::createFrom(_corelexocadclass_* aObj) \
{ \
if(aObj) return std::make_shared<_openlexocadclass_>(aObj); \
else return nullptr; \
}
#define PROXY_SOURCE_ABSTRACT(_openlexocadclass_, _corelexocadclass_, _type_)
Definition: Globals.h:185

◆ PROXY_SOURCE_ABSTRACT

#define PROXY_SOURCE_ABSTRACT (   _openlexocadclass_,
  _corelexocadclass_,
  _type_ 
)
Value:
_corelexocadclass_* _openlexocadclass_::__getCasted__() const \
{ \
auto casted = dynamic_cast<_corelexocadclass_*>(_coreObj); \
return casted; \
}

◆ PROXY_SOURCE_CUSTOM_CREATE

#define PROXY_SOURCE_CUSTOM_CREATE (   _openlexocadclass_,
  _corelexocadclass_,
  _type_ 
)    PROXY_SOURCE_ABSTRACT(_openlexocadclass_, _corelexocadclass_, _type_)

Variable Documentation

◆ AddSelection

AddSelection

◆ AXO_BACK_LEFT

AXO_BACK_LEFT

◆ AXO_LEFT

AXO_LEFT

◆ BeforeSave

BeforeSave

◆ ClearSelection

ClearSelection

◆ CloseDocument

CloseDocument

◆ CSHARP

CSHARP

◆ FileOpened

FileOpened

◆ NewDocument

NewDocument

◆ NewFile

NewFile

◆ NX

NX

◆ NY

NY

◆ NZ

NZ

◆ PYTHON

PYTHON

◆ RecomputeFinished

RecomputeFinished

◆ RemoveActivePoint

RemoveActivePoint

◆ RemoveSelection

RemoveSelection

◆ SetActiveDocument

SetActiveDocument

◆ SetActivePoint

SetActivePoint

◆ UpdateSelection

UpdateSelection

◆ X

X

◆ Y

Y

◆ Z

Z