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> 52 class DocumentObserver;
64 friend class ApplicationP;
80 bool isEditing()
const;
81 void addObject(std::shared_ptr<DocObject> aObject);
84 void deleteObjects(
const std::vector<std::shared_ptr<DocObject>>& aObjects);
85 void copyObjectsFrom(std::shared_ptr<Document> other);
91 void attachDocumentObserver(std::shared_ptr<DocumentObserver> aObserver);
92 void detachDocumentObserver(std::shared_ptr<DocumentObserver> aObserver);
98 const std::vector<std::shared_ptr<Element>>& elements,
100 bool exportFacesAsLines,
102 bool saveForWeb(
const Base::String& fileOrDirName,
bool aSingleHtmlFile =
false);
109 void setZeropointXYZ(
const Geom::XYZ& xyz);
111 void setZeropointLok(
const Geom::Pnt& pnt);
112 double getZeropointAngle();
113 void setZeropointAngle(
double value);
122 bool runCommand(
const std::string& cmdName);
124 static std::vector<std::string> getCommandNames();
129 std::vector<int> getLayerNumbers()
const;
130 int addLayer(
const Base::String& layerName,
bool isVisible =
true,
bool isFrozen =
false);
131 bool getLayerName(
int layerNumber,
Base::String& layerName)
const;
132 bool setLayerName(
int layerNumber,
const Base::String& layerName);
133 bool setLayerVisible(
int layerNumber,
bool isVisible);
134 bool getLayerVisible(
int layerNumber,
bool& isVisible)
const;
135 bool setLayerFrozen(
int layerNumber,
bool isFrozen);
136 bool getLayerFrozen(
int layerNumber,
bool& isFrozen)
const;
141 std::shared_ptr<Element> getElementByGlobalId(
const Base::GlobalId& aGlobalId);
142 std::vector<std::shared_ptr<Element>> getElements();
143 std::vector<std::shared_ptr<Element>> getElements(std::function<
bool(std::shared_ptr<Element> aElement)> aFilter);
144 std::shared_ptr<Root> getRootByGlobalId(
const Base::GlobalId& aGlobalId);
145 std::vector<std::shared_ptr<Root>> getRoots();
146 std::vector<std::shared_ptr<Root>> getRoots(std::function<
bool(std::shared_ptr<Root> aRoot)> aFilter);
147 std::vector<std::shared_ptr<DocObject>>
getObjects();
148 std::vector<std::shared_ptr<DocObject>>
getObjects(std::function<
bool(std::shared_ptr<DocObject> aObject)> aFilter);
150 std::vector<std::shared_ptr<Element>> getElementsByBimNumber(
const Base::String& componentName,
bool useRegularExpression =
false);
151 std::vector<std::shared_ptr<Element>> getElementsByBimColor(
const int& cadworkColor);
153 std::vector<std::shared_ptr<SpatialElement>> getSpatialElements();
154 std::vector<std::shared_ptr<Site>> getSites();
155 std::vector<std::shared_ptr<Building>> getBuildings();
156 std::vector<std::shared_ptr<BuildingStorey>> getBuildingStoreys();
157 std::vector<std::shared_ptr<Space>> getSpaces();
159 std::shared_ptr<Element> getActiveElement();
160 std::shared_ptr<Site> getActiveSite();
161 std::shared_ptr<Building> getActiveBuilding();
162 std::shared_ptr<BuildingStorey> getActiveBuildingStorey();
167 Draw::PointStyle getActivePointStyle()
const;
168 Draw::CurveStyle getActiveCurveStyle()
const;
169 Draw::SurfaceStyle getActiveSurfaceStyle()
const;
170 Draw::TextStyle getActiveTextStyle()
const;
171 Draw::DimensionStyle getActiveDimensionStyle()
const;
172 Draw::CurveStyle getActiveAuxiliaryCurveStyle()
const;
173 Draw::SolidStyle getActiveSpineStyle()
const;
174 Draw::ExtrusionStyle getActiveExtrusionStyle()
const;
176 void setActivePointStyle(
const Draw::PointStyle& ps);
177 void setActiveCurveStyle(
const Draw::CurveStyle& cs);
178 void setActiveSurfaceStyle(
const Draw::SurfaceStyle& ss);
179 void setActiveTextStyle(
const Draw::TextStyle& ts);
180 void setActiveDimensionStyle(
const Draw::DimensionStyle& ds);
181 void setActiveAuxiliaryCurveStyle(
const Draw::CurveStyle& cs);
182 void setActiveSpineStyle(
const Draw::SolidStyle& ss);
183 void setActiveExtrusionStyle(
const Draw::ExtrusionStyle& ss);
190 double getRotationZ_WCS()
const;
210 _appDoc = other._appDoc;
214 bool isEqual(std::shared_ptr<Document> other)
const {
return (*
this == *other); }
230 std::shared_ptr<DocObjectFactory> create();
239 static void startTimer();
240 static int stopTimer();
241 static int elapsedTime();
242 static int elapsedTimeForTextures();
243 static int elapsedTimeForLocalAxes();
247 static void __addTextureTimeInMS__(
int ms);
248 static void __addSetLocalAxesTimeInMS__(
int ms);
249 static void __addRecomputeCount__();
253 App::Document* _appDoc =
nullptr;
255 static int textureTimeInMS;
256 static int setLocalAxesTimeInMS;
257 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:43
static std::set< std::string > commandSet
Definition: Document.h:233
size_t getRecomputeCount() const
get count of recomputes()
Document(const Document &other)
Definition: Document.h:206
Core::PropertyText name
Definition: CoreDocument.h:167
Core::PropertyText company
Definition: CoreDocument.h:181
A Utf-16 (windows) or ucs4 (unix) encoded string class.
Definition: String.h:23
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:182
Definition: CoreDocument.h:210
friend bool operator!=(const Document &x, const Document &y)
Definition: Document.h:219
bool addObject(Core::DocObject *e)
Adds an existing object to the document.
friend bool operator>=(const Document &x, const Document &y)
Definition: Document.h:225
Document holding all persistent DocObjects.
Definition: Document.h:60
friend bool operator>(const Document &x, const Document &y)
Definition: Document.h:223
Definition: GlobalId.h:29
Definition: ActiveScript.h:7
Core::PropertyText filename
Definition: CoreDocument.h:176
bool isEqual(std::shared_ptr< Document > other) const
Definition: Document.h:214
friend bool operator<=(const Document &x, const Document &y)
Definition: Document.h:224
Core::PropertyText createdBy
Definition: CoreDocument.h:177
Base::String getTmpDirectory()
Returns the temporary directory.
friend bool operator<(const Document &x, const Document &y)
Definition: Document.h:222
The one and only Application.
Definition: Application.h:49
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:218
Document & operator=(const Document &other)
Definition: Document.h:208
Document()
Definition: Document.h:235
Definition: DocObject.h:51