24 #include <Draw/CurveStyle.h> 25 #include <Draw/DimensionStyle.h> 26 #include <Draw/ExtrusionStyle.h> 27 #include <Draw/PointStyle.h> 28 #include <Draw/SolidStyle.h> 29 #include <Draw/SurfaceStyle.h> 30 #include <Draw/TextStyle.h> 31 #include <LxIfc4/IFC4_impl/LxIfc4EntityEnums.h> 54 class DocumentObserver;
66 friend class ApplicationP;
82 bool isEditing()
const;
83 void addObject(std::shared_ptr<DocObject> aObject);
86 void deleteObjects(
const std::vector<std::shared_ptr<DocObject>>& aObjects);
87 void copyObjectsFrom(std::shared_ptr<Document> other);
93 void attachDocumentObserver(std::shared_ptr<DocumentObserver> aObserver);
94 void detachDocumentObserver(std::shared_ptr<DocumentObserver> aObserver);
100 const std::vector<std::shared_ptr<Element>>& elements,
102 bool exportFacesAsLines,
104 bool saveForWeb(
const Base::String& fileOrDirName,
bool aSingleHtmlFile =
false);
111 void setZeropointXYZ(
const Geom::XYZ& xyz);
113 void setZeropointLok(
const Geom::Pnt& pnt);
114 double getZeropointAngle();
115 void setZeropointAngle(
double value);
124 bool runCommand(
const std::string& cmdName);
126 static std::vector<std::string> getCommandNames();
131 std::vector<int> getLayerNumbers()
const;
132 int addLayer(
const Base::String& layerName,
bool isVisible =
true,
bool isFrozen =
false);
133 bool getLayerName(
int layerNumber,
Base::String& layerName)
const;
134 bool setLayerName(
int layerNumber,
const Base::String& layerName);
135 bool setLayerVisible(
int layerNumber,
bool isVisible);
136 bool getLayerVisible(
int layerNumber,
bool& isVisible)
const;
137 bool setLayerFrozen(
int layerNumber,
bool isFrozen);
138 bool getLayerFrozen(
int layerNumber,
bool& isFrozen)
const;
143 std::shared_ptr<Element> getElementByGlobalId(
const Base::GlobalId& aGlobalId);
144 std::vector<std::shared_ptr<Element>> getElements();
145 std::vector<std::shared_ptr<Element>> getElements(std::function<
bool(std::shared_ptr<Element> aElement)> aFilter);
146 std::shared_ptr<Root> getRootByGlobalId(
const Base::GlobalId& aGlobalId);
147 std::vector<std::shared_ptr<Root>> getRoots();
148 std::vector<std::shared_ptr<Root>> getRoots(std::function<
bool(std::shared_ptr<Root> aRoot)> aFilter);
149 std::vector<std::shared_ptr<DocObject>>
getObjects();
150 std::vector<std::shared_ptr<DocObject>>
getObjects(std::function<
bool(std::shared_ptr<DocObject> aObject)> aFilter);
152 std::vector<std::shared_ptr<Element>> getElementsByBimNumber(
const Base::String& componentName,
bool useRegularExpression =
false);
153 std::vector<std::shared_ptr<Element>> getElementsByBimColor(
const int& cadworkColor);
155 std::vector<std::shared_ptr<SpatialElement>> getSpatialElements();
156 std::vector<std::shared_ptr<Site>> getSites();
157 std::vector<std::shared_ptr<Building>> getBuildings();
158 std::vector<std::shared_ptr<BuildingStorey>> getBuildingStoreys();
159 std::vector<std::shared_ptr<Space>> getSpaces();
161 std::shared_ptr<Element> getActiveElement();
162 std::shared_ptr<Site> getActiveSite();
163 std::shared_ptr<Building> getActiveBuilding();
164 std::shared_ptr<BuildingStorey> getActiveBuildingStorey();
169 Draw::PointStyle getActivePointStyle()
const;
170 Draw::CurveStyle getActiveCurveStyle()
const;
171 Draw::SurfaceStyle getActiveSurfaceStyle()
const;
172 Draw::TextStyle getActiveTextStyle()
const;
173 Draw::DimensionStyle getActiveDimensionStyle()
const;
174 Draw::CurveStyle getActiveAuxiliaryCurveStyle()
const;
175 Draw::SolidStyle getActiveSpineStyle()
const;
176 Draw::ExtrusionStyle getActiveExtrusionStyle()
const;
178 void setActivePointStyle(
const Draw::PointStyle& ps);
179 void setActiveCurveStyle(
const Draw::CurveStyle& cs);
180 void setActiveSurfaceStyle(
const Draw::SurfaceStyle& ss);
181 void setActiveTextStyle(
const Draw::TextStyle& ts);
182 void setActiveDimensionStyle(
const Draw::DimensionStyle& ds);
183 void setActiveAuxiliaryCurveStyle(
const Draw::CurveStyle& cs);
184 void setActiveSpineStyle(
const Draw::SolidStyle& ss);
185 void setActiveExtrusionStyle(
const Draw::ExtrusionStyle& ss);
192 double getRotationZ_WCS()
const;
212 _appDoc = other._appDoc;
216 bool isEqual(std::shared_ptr<Document> other)
const {
return (*
this == *other); }
232 std::shared_ptr<DocObjectFactory> create();
241 static void startTimer();
242 static int stopTimer();
243 static int elapsedTime();
244 static int elapsedTimeForTextures();
245 static int elapsedTimeForLocalAxes();
249 static void __addTextureTimeInMS__(
int ms);
250 static void __addSetLocalAxesTimeInMS__(
int ms);
251 static void __addRecomputeCount__();
255 App::Document* _appDoc =
nullptr;
257 static int textureTimeInMS;
258 static int setLocalAxesTimeInMS;
259 static int recomputeCnt;
virtual void recompute()
Recomputes the document.
void removeObject(Core::DocObject *e)
Removes an object from the document.
Defines a non-persistent 3D Cartesian point.
Definition: Pnt.h:42
static std::set< std::string > commandSet
Definition: Document.h:235
size_t getRecomputeCount() const
get count of recomputes()
Document(const Document &other)
Definition: Document.h:208
Core::PropertyText name
Definition: CoreDocument.h:143
Core::PropertyText company
Definition: CoreDocument.h:156
A Utf-16 (windows) or ucs4 (unix) encoded string class.
Definition: String.h:29
virtual void deleteObject(Core::DocObject *o)
Physically deletes an object without informing the object maps.
virtual bool saveAs(const Base::String &filename)
Saves the document under this name.
Core::PropertyText comment
Definition: CoreDocument.h:157
Definition: CoreDocument.h:197
friend bool operator!=(const Document &x, const Document &y)
Definition: Document.h:221
bool addObject(Core::DocObject *e)
Adds an existing object to the document.
friend bool operator>=(const Document &x, const Document &y)
Definition: Document.h:227
Document holding all persistent DocObjects.
Definition: Document.h:62
#define OPENLXAPP_EXPORT
Definition: OpenLxApp_defines.h:12
friend bool operator>(const Document &x, const Document &y)
Definition: Document.h:225
Definition: GlobalId.h:32
Definition: ActiveScript.h:9
Core::PropertyText filename
Definition: CoreDocument.h:151
bool isEqual(std::shared_ptr< Document > other) const
Definition: Document.h:216
friend bool operator<=(const Document &x, const Document &y)
Definition: Document.h:226
Core::PropertyText createdBy
Definition: CoreDocument.h:152
Base::String getTmpDirectory()
Returns the temporary directory.
friend bool operator<(const Document &x, const Document &y)
Definition: Document.h:224
The one and only Application.
Definition: Application.h:50
std::vector< Core::DocObject * > getObjects(bool includeDeletedObjects=false) const
Returns all objects in the document.
friend bool operator==(const Document &x, const Document &y)
Definition: Document.h:220
Document & operator=(const Document &other)
Definition: Document.h:210
Document()
Definition: Document.h:237
Definition: DocObject.h:28