OpenLexocad  27.1
OpenLxApp::Document Class Reference

Document holding all persistent DocObjects. More...

#include <Document.h>

Public Member Functions

bool saveAs (const Base::String &filename)
 
bool saveAs (const Base::String &format, const Base::String &filename)
 
bool saveAs2dl (const Base::String &filename, const std::vector< std::shared_ptr< Element >> &elements, const Geom::Ax2 &axis, bool exportFacesAsLines, bool forLexo2d)
 
bool saveForWeb (const Base::String &fileOrDirName, bool aSingleHtmlFile=false)
 
bool createAutomaticWedgeMesh (const Base::String &xlsFileName=Base::String(), const Base::String &fileName2dl=Base::String())
 
Base::String getTmpDirectory () const
 
std::shared_ptr< ElementaddVariant (const Base::String &aFileValName, const Geom::Ax2 &position)
 
std::shared_ptr< Elementimport2dvFile (const Base::String &aFile2dvName, const Geom::Ax2 &position)
 
 Document (const Base::String &name, const Base::String &typeName=L"")
 
 Document (App::Document *appDoc, const Base::String &name)
 
 Document (const Document &other)
 
Documentoperator= (const Document &other)
 
bool isEqual (std::shared_ptr< Document > other) const
 
 Document (App::Document *aDoc)
 
 ~Document (void)
 
std::shared_ptr< DocObjectFactorycreate ()
 
 Document ()
 
Attributes
Base::String getName () const
 
void setCompany (const Base::String &company)
 
void setComment (const Base::String &comment)
 
void setCreatedBy (const Base::String &createdBy)
 
Editing
void beginEditing ()
 
void endEditing ()
 
bool isEditing () const
 
void addObject (std::shared_ptr< DocObject > aObject)
 
void removeObject (std::shared_ptr< DocObject > aObject)
 
void deleteObject (std::shared_ptr< DocObject > aObject)
 
void deleteObjects (const std::vector< std::shared_ptr< DocObject >> &aObjects)
 
void copyObjectsFrom (std::shared_ptr< Document > other)
 
void recompute ()
 
Observer
void attachDocumentObserver (std::shared_ptr< DocumentObserver > aObserver)
 
void detachDocumentObserver (std::shared_ptr< DocumentObserver > aObserver)
 
Zeropoint - Origin
Geom::XYZ getZeropointXYZ ()
 
void setZeropointXYZ (const Geom::XYZ &xyz)
 
Geom::Pnt getZeropointLok ()
 
void setZeropointLok (const Geom::Pnt &pnt)
 
double getZeropointAngle ()
 
void setZeropointAngle (double value)
 
Layer
std::vector< int > getLayerNumbers () const
 
int addLayer (const Base::String &layerName, bool isVisible=true, bool isFrozen=false)
 
bool getLayerName (int layerNumber, Base::String &layerName) const
 
bool setLayerName (int layerNumber, const Base::String &layerName)
 
bool setLayerVisible (int layerNumber, bool isVisible)
 
bool getLayerVisible (int layerNumber, bool &isVisible) const
 
bool setLayerFrozen (int layerNumber, bool isFrozen)
 
bool getLayerFrozen (int layerNumber, bool &isFrozen) const
 
Finding DocObjects
std::shared_ptr< ElementgetElementByGlobalId (const Base::GlobalId &aGlobalId)
 
std::vector< std::shared_ptr< Element > > getElements ()
 
std::vector< std::shared_ptr< Element > > getElements (std::function< bool(std::shared_ptr< Element > aElement)> aFilter)
 
std::shared_ptr< RootgetRootByGlobalId (const Base::GlobalId &aGlobalId)
 
std::vector< std::shared_ptr< Root > > getRoots ()
 
std::vector< std::shared_ptr< Root > > getRoots (std::function< bool(std::shared_ptr< Root > aRoot)> aFilter)
 
std::vector< std::shared_ptr< DocObject > > getObjects ()
 
std::vector< std::shared_ptr< DocObject > > getObjects (std::function< bool(std::shared_ptr< DocObject > aObject)> aFilter)
 
std::vector< std::shared_ptr< Element > > getElementsByBimNumber (const Base::String &componentName, bool useRegularExpression=false)
 
std::vector< std::shared_ptr< Element > > getElementsByBimColor (const int &cadworkColor)
 
std::vector< std::shared_ptr< SpatialElement > > getSpatialElements ()
 
std::vector< std::shared_ptr< Site > > getSites ()
 
std::vector< std::shared_ptr< Building > > getBuildings ()
 
std::vector< std::shared_ptr< BuildingStorey > > getBuildingStoreys ()
 
std::vector< std::shared_ptr< Space > > getSpaces ()
 
std::shared_ptr< ElementgetActiveElement ()
 
std::shared_ptr< SitegetActiveSite ()
 
std::shared_ptr< BuildinggetActiveBuilding ()
 
std::shared_ptr< BuildingStoreygetActiveBuildingStorey ()
 
Styles
Draw::PointStyle getActivePointStyle () const
 
Draw::CurveStyle getActiveCurveStyle () const
 
Draw::SurfaceStyle getActiveSurfaceStyle () const
 
Draw::TextStyle getActiveTextStyle () const
 
Draw::DimensionStyle getActiveDimensionStyle () const
 
Draw::CurveStyle getActiveAuxiliaryCurveStyle () const
 
Draw::SolidStyle getActiveSpineStyle () const
 
Draw::ExtrusionStyle getActiveExtrusionStyle () const
 
void setActivePointStyle (const Draw::PointStyle &ps)
 
void setActiveCurveStyle (const Draw::CurveStyle &cs)
 
void setActiveSurfaceStyle (const Draw::SurfaceStyle &ss)
 
void setActiveTextStyle (const Draw::TextStyle &ts)
 
void setActiveDimensionStyle (const Draw::DimensionStyle &ds)
 
void setActiveAuxiliaryCurveStyle (const Draw::CurveStyle &cs)
 
void setActiveSpineStyle (const Draw::SolidStyle &ss)
 
void setActiveExtrusionStyle (const Draw::ExtrusionStyle &ss)
 
WCS - WorldCoordinateSystem
void set_WCS (const Geom::Ax2 &axis)
 
void reset_WCS ()
 
double getRotationZ_WCS () const
 
Geom::Pnt getLocation_WCS () const
 
Geom::Dir getGlobalX_WCS () const
 
Geom::Dir getGlobalY_WCS () const
 
Geom::Dir getGlobalZ_WCS () const
 
Python
bool registerPythonScript (const Base::GlobalId &aScriptId, const Base::String &aScriptFilePath=L"")
 

Static Public Attributes

static std::set< std::string > commandSet
 

Friends

class Application
 
class ApplicationP
 
bool operator== (const Document &x, const Document &y)
 
bool operator!= (const Document &x, const Document &y)
 
bool operator< (const Document &x, const Document &y)
 
bool operator> (const Document &x, const Document &y)
 
bool operator<= (const Document &x, const Document &y)
 
bool operator>= (const Document &x, const Document &y)
 

Commands

bool runCommand (const std::string &cmdName)
 
bool runCommand (Core::Command *cmd)
 
static std::vector< std::string > getCommandNames ()
 

Detailed Description

Document holding all persistent DocObjects.

Constructor & Destructor Documentation

◆ Document() [1/5]

OpenLxApp::Document::Document ( const Base::String name,
const Base::String typeName = L"" 
)

◆ Document() [2/5]

OpenLxApp::Document::Document ( App::Document *  appDoc,
const Base::String name 
)

◆ Document() [3/5]

OpenLxApp::Document::Document ( const Document other)
inlineexplicit

◆ Document() [4/5]

OpenLxApp::Document::Document ( App::Document *  aDoc)

◆ ~Document()

OpenLxApp::Document::~Document ( void  )

◆ Document() [5/5]

OpenLxApp::Document::Document ( )
inline

Member Function Documentation

◆ addLayer()

int OpenLxApp::Document::addLayer ( const Base::String layerName,
bool  isVisible = true,
bool  isFrozen = false 
)

◆ addObject()

void OpenLxApp::Document::addObject ( std::shared_ptr< DocObject aObject)

◆ addVariant()

std::shared_ptr<Element> OpenLxApp::Document::addVariant ( const Base::String aFileValName,
const Geom::Ax2 position 
)

◆ attachDocumentObserver()

void OpenLxApp::Document::attachDocumentObserver ( std::shared_ptr< DocumentObserver aObserver)

◆ beginEditing()

void OpenLxApp::Document::beginEditing ( )

◆ copyObjectsFrom()

void OpenLxApp::Document::copyObjectsFrom ( std::shared_ptr< Document other)

◆ create()

std::shared_ptr<DocObjectFactory> OpenLxApp::Document::create ( )

◆ createAutomaticWedgeMesh()

bool OpenLxApp::Document::createAutomaticWedgeMesh ( const Base::String xlsFileName = Base::String(),
const Base::String fileName2dl = Base::String() 
)

◆ deleteObject()

void OpenLxApp::Document::deleteObject ( std::shared_ptr< DocObject aObject)

◆ deleteObjects()

void OpenLxApp::Document::deleteObjects ( const std::vector< std::shared_ptr< DocObject >> &  aObjects)

◆ detachDocumentObserver()

void OpenLxApp::Document::detachDocumentObserver ( std::shared_ptr< DocumentObserver aObserver)

◆ endEditing()

void OpenLxApp::Document::endEditing ( )

◆ getActiveAuxiliaryCurveStyle()

Draw::CurveStyle OpenLxApp::Document::getActiveAuxiliaryCurveStyle ( ) const

◆ getActiveBuilding()

std::shared_ptr<Building> OpenLxApp::Document::getActiveBuilding ( )

◆ getActiveBuildingStorey()

std::shared_ptr<BuildingStorey> OpenLxApp::Document::getActiveBuildingStorey ( )

◆ getActiveCurveStyle()

Draw::CurveStyle OpenLxApp::Document::getActiveCurveStyle ( ) const

◆ getActiveDimensionStyle()

Draw::DimensionStyle OpenLxApp::Document::getActiveDimensionStyle ( ) const

◆ getActiveElement()

std::shared_ptr<Element> OpenLxApp::Document::getActiveElement ( )

◆ getActiveExtrusionStyle()

Draw::ExtrusionStyle OpenLxApp::Document::getActiveExtrusionStyle ( ) const

◆ getActivePointStyle()

Draw::PointStyle OpenLxApp::Document::getActivePointStyle ( ) const

◆ getActiveSite()

std::shared_ptr<Site> OpenLxApp::Document::getActiveSite ( )

◆ getActiveSpineStyle()

Draw::SolidStyle OpenLxApp::Document::getActiveSpineStyle ( ) const

◆ getActiveSurfaceStyle()

Draw::SurfaceStyle OpenLxApp::Document::getActiveSurfaceStyle ( ) const

◆ getActiveTextStyle()

Draw::TextStyle OpenLxApp::Document::getActiveTextStyle ( ) const

◆ getBuildings()

std::vector<std::shared_ptr<Building> > OpenLxApp::Document::getBuildings ( )

◆ getBuildingStoreys()

std::vector<std::shared_ptr<BuildingStorey> > OpenLxApp::Document::getBuildingStoreys ( )

◆ getCommandNames()

static std::vector<std::string> OpenLxApp::Document::getCommandNames ( )
static

◆ getElementByGlobalId()

std::shared_ptr<Element> OpenLxApp::Document::getElementByGlobalId ( const Base::GlobalId aGlobalId)

◆ getElements() [1/2]

std::vector<std::shared_ptr<Element> > OpenLxApp::Document::getElements ( )

◆ getElements() [2/2]

std::vector<std::shared_ptr<Element> > OpenLxApp::Document::getElements ( std::function< bool(std::shared_ptr< Element > aElement)>  aFilter)

◆ getElementsByBimColor()

std::vector<std::shared_ptr<Element> > OpenLxApp::Document::getElementsByBimColor ( const int &  cadworkColor)

◆ getElementsByBimNumber()

std::vector<std::shared_ptr<Element> > OpenLxApp::Document::getElementsByBimNumber ( const Base::String componentName,
bool  useRegularExpression = false 
)

◆ getGlobalX_WCS()

Geom::Dir OpenLxApp::Document::getGlobalX_WCS ( ) const

◆ getGlobalY_WCS()

Geom::Dir OpenLxApp::Document::getGlobalY_WCS ( ) const

◆ getGlobalZ_WCS()

Geom::Dir OpenLxApp::Document::getGlobalZ_WCS ( ) const

◆ getLayerFrozen()

bool OpenLxApp::Document::getLayerFrozen ( int  layerNumber,
bool &  isFrozen 
) const

◆ getLayerName()

bool OpenLxApp::Document::getLayerName ( int  layerNumber,
Base::String layerName 
) const

◆ getLayerNumbers()

std::vector<int> OpenLxApp::Document::getLayerNumbers ( ) const

◆ getLayerVisible()

bool OpenLxApp::Document::getLayerVisible ( int  layerNumber,
bool &  isVisible 
) const

◆ getLocation_WCS()

Geom::Pnt OpenLxApp::Document::getLocation_WCS ( ) const

◆ getName()

Base::String OpenLxApp::Document::getName ( ) const

◆ getObjects() [1/2]

std::vector<std::shared_ptr<DocObject> > OpenLxApp::Document::getObjects ( )

◆ getObjects() [2/2]

std::vector<std::shared_ptr<DocObject> > OpenLxApp::Document::getObjects ( std::function< bool(std::shared_ptr< DocObject > aObject)>  aFilter)

◆ getRootByGlobalId()

std::shared_ptr<Root> OpenLxApp::Document::getRootByGlobalId ( const Base::GlobalId aGlobalId)

◆ getRoots() [1/2]

std::vector<std::shared_ptr<Root> > OpenLxApp::Document::getRoots ( )

◆ getRoots() [2/2]

std::vector<std::shared_ptr<Root> > OpenLxApp::Document::getRoots ( std::function< bool(std::shared_ptr< Root > aRoot)>  aFilter)

◆ getRotationZ_WCS()

double OpenLxApp::Document::getRotationZ_WCS ( ) const

◆ getSites()

std::vector<std::shared_ptr<Site> > OpenLxApp::Document::getSites ( )

◆ getSpaces()

std::vector<std::shared_ptr<Space> > OpenLxApp::Document::getSpaces ( )

◆ getSpatialElements()

std::vector<std::shared_ptr<SpatialElement> > OpenLxApp::Document::getSpatialElements ( )

◆ getTmpDirectory()

Base::String OpenLxApp::Document::getTmpDirectory ( ) const

◆ getZeropointAngle()

double OpenLxApp::Document::getZeropointAngle ( )

◆ getZeropointLok()

Geom::Pnt OpenLxApp::Document::getZeropointLok ( )

◆ getZeropointXYZ()

Geom::XYZ OpenLxApp::Document::getZeropointXYZ ( )

◆ import2dvFile()

std::shared_ptr<Element> OpenLxApp::Document::import2dvFile ( const Base::String aFile2dvName,
const Geom::Ax2 position 
)

◆ isEditing()

bool OpenLxApp::Document::isEditing ( ) const

◆ isEqual()

bool OpenLxApp::Document::isEqual ( std::shared_ptr< Document other) const
inline

◆ operator=()

Document& OpenLxApp::Document::operator= ( const Document other)
inline

◆ recompute()

void OpenLxApp::Document::recompute ( )

◆ registerPythonScript()

bool OpenLxApp::Document::registerPythonScript ( const Base::GlobalId aScriptId,
const Base::String aScriptFilePath = L"" 
)

◆ removeObject()

void OpenLxApp::Document::removeObject ( std::shared_ptr< DocObject aObject)

◆ reset_WCS()

void OpenLxApp::Document::reset_WCS ( )

◆ runCommand() [1/2]

bool OpenLxApp::Document::runCommand ( const std::string &  cmdName)

◆ runCommand() [2/2]

bool OpenLxApp::Document::runCommand ( Core::Command cmd)

◆ saveAs() [1/2]

bool OpenLxApp::Document::saveAs ( const Base::String filename)

◆ saveAs() [2/2]

bool OpenLxApp::Document::saveAs ( const Base::String format,
const Base::String filename 
)

◆ saveAs2dl()

bool OpenLxApp::Document::saveAs2dl ( const Base::String filename,
const std::vector< std::shared_ptr< Element >> &  elements,
const Geom::Ax2 axis,
bool  exportFacesAsLines,
bool  forLexo2d 
)

◆ saveForWeb()

bool OpenLxApp::Document::saveForWeb ( const Base::String fileOrDirName,
bool  aSingleHtmlFile = false 
)

◆ set_WCS()

void OpenLxApp::Document::set_WCS ( const Geom::Ax2 axis)

◆ setActiveAuxiliaryCurveStyle()

void OpenLxApp::Document::setActiveAuxiliaryCurveStyle ( const Draw::CurveStyle &  cs)

◆ setActiveCurveStyle()

void OpenLxApp::Document::setActiveCurveStyle ( const Draw::CurveStyle &  cs)

◆ setActiveDimensionStyle()

void OpenLxApp::Document::setActiveDimensionStyle ( const Draw::DimensionStyle &  ds)

◆ setActiveExtrusionStyle()

void OpenLxApp::Document::setActiveExtrusionStyle ( const Draw::ExtrusionStyle &  ss)

◆ setActivePointStyle()

void OpenLxApp::Document::setActivePointStyle ( const Draw::PointStyle &  ps)

◆ setActiveSpineStyle()

void OpenLxApp::Document::setActiveSpineStyle ( const Draw::SolidStyle &  ss)

◆ setActiveSurfaceStyle()

void OpenLxApp::Document::setActiveSurfaceStyle ( const Draw::SurfaceStyle &  ss)

◆ setActiveTextStyle()

void OpenLxApp::Document::setActiveTextStyle ( const Draw::TextStyle &  ts)

◆ setComment()

void OpenLxApp::Document::setComment ( const Base::String comment)

◆ setCompany()

void OpenLxApp::Document::setCompany ( const Base::String company)

◆ setCreatedBy()

void OpenLxApp::Document::setCreatedBy ( const Base::String createdBy)

◆ setLayerFrozen()

bool OpenLxApp::Document::setLayerFrozen ( int  layerNumber,
bool  isFrozen 
)

◆ setLayerName()

bool OpenLxApp::Document::setLayerName ( int  layerNumber,
const Base::String layerName 
)

◆ setLayerVisible()

bool OpenLxApp::Document::setLayerVisible ( int  layerNumber,
bool  isVisible 
)

◆ setZeropointAngle()

void OpenLxApp::Document::setZeropointAngle ( double  value)

◆ setZeropointLok()

void OpenLxApp::Document::setZeropointLok ( const Geom::Pnt pnt)

◆ setZeropointXYZ()

void OpenLxApp::Document::setZeropointXYZ ( const Geom::XYZ xyz)

Friends And Related Function Documentation

◆ Application

friend class Application
friend

◆ ApplicationP

friend class ApplicationP
friend

◆ operator!=

bool operator!= ( const Document x,
const Document y 
)
friend

◆ operator<

bool operator< ( const Document x,
const Document y 
)
friend

◆ operator<=

bool operator<= ( const Document x,
const Document y 
)
friend

◆ operator==

bool operator== ( const Document x,
const Document y 
)
friend

◆ operator>

bool operator> ( const Document x,
const Document y 
)
friend

◆ operator>=

bool operator>= ( const Document x,
const Document y 
)
friend

Member Data Documentation

◆ commandSet

std::set<std::string> OpenLxApp::Document::commandSet
static

The documentation for this class was generated from the following file: