OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
BooleanOperations.h
Go to the documentation of this file.
1#pragma once
2
3namespace ot
4{
5 class EntityInformation;
6}
7
8#include <list>
9#include <string>
10
11#include "ShapesBase.h"
12
15
16#include "TopoDS_TShape.hxx"
17#include "TopTools_ListOfShape.hxx"
18
19class EntityBrep;
20class EntityGeometry;
21class EntityCache;
22class TopoDS_Shape;
23class BRepAlgoAPI_BuilderAlgo;
24class ClassFactory;
25
27{
28public:
29 BooleanOperations(ot::components::UiComponent *_uiComponent, ot::components::ModelComponent *_modelComponent, const std::string &_serviceName, EntityCache *_entityCache, ot::serviceID_t _serviceID, ClassFactory* _classFactory);
31
32 void enterAddMode(const std::list<ot::EntityInformation> &selectedGeometryEntities);
33 void enterSubtractMode(const std::list<ot::EntityInformation> &selectedGeometryEntities);
34 void enterIntersectMode(const std::list<ot::EntityInformation> &selectedGeometryEntities);
35 void perfromOperationForSelectedEntities(const std::string &selectionAction, const std::string &selectionInfo, std::map<std::string, std::string> &options);
36 bool performOperation(const std::string &selectionAction, EntityBrep *baseBrepEntity, std::list<EntityBrep *> &brepEntities, TopoDS_Shape &shape, std::string &treeIconVisible, std::string &treeIconHidden, std::map< const opencascade::handle<TopoDS_TShape>, std::string>& resultFaceNames);
37
39
40private:
41 bool add(EntityBrep *base, std::list<EntityBrep *> &tools, TopoDS_Shape &shape, std::map< const opencascade::handle<TopoDS_TShape>, std::string>& resultFaceNames);
42 bool subtract(EntityBrep *base, std::list<EntityBrep *> &tools, TopoDS_Shape &shape, std::map< const opencascade::handle<TopoDS_TShape>, std::string>& resultFaceNames);
43 bool intersect(EntityBrep *base, std::list<EntityBrep *> &tools, TopoDS_Shape &shape, std::map< const opencascade::handle<TopoDS_TShape>, std::string>& resultFaceNames);
44 void preOperation(TopoDS_Shape& shapeA, const std::map< const opencascade::handle<TopoDS_TShape>, std::string>& faceNamesA, TopoDS_Shape& shapeB, const std::map< const opencascade::handle<TopoDS_TShape>, std::string>& faceNamesB);
45 std::map< const opencascade::handle<TopoDS_TShape>, std::string> postOperation(BRepAlgoAPI_BuilderAlgo& theAlgo, TopoDS_Shape& resultShape, TopoDS_Shape& shapeA, TopoDS_Shape& shapeB);
46
47 TopTools_ListOfShape anArguments;
48 std::map< const opencascade::handle<TopoDS_TShape>, std::string> allFaceNames;
49};
Definition BooleanOperations.h:27
void perfromOperationForSelectedEntities(const std::string &selectionAction, const std::string &selectionInfo, std::map< std::string, std::string > &options)
Definition BooleanOperations.cpp:91
~BooleanOperations()
Definition BooleanOperations.h:30
BooleanOperations()=delete
void enterAddMode(const std::list< ot::EntityInformation > &selectedGeometryEntities)
Definition BooleanOperations.cpp:34
void enterSubtractMode(const std::list< ot::EntityInformation > &selectedGeometryEntities)
Definition BooleanOperations.cpp:53
void enterIntersectMode(const std::list< ot::EntityInformation > &selectedGeometryEntities)
Definition BooleanOperations.cpp:72
bool performOperation(const std::string &selectionAction, EntityBrep *baseBrepEntity, std::list< EntityBrep * > &brepEntities, TopoDS_Shape &shape, std::string &treeIconVisible, std::string &treeIconHidden, std::map< const opencascade::handle< TopoDS_TShape >, std::string > &resultFaceNames)
Definition BooleanOperations.cpp:501
Definition EntityCache.h:26
Definition ShapesBase.h:19
Definition ModelComponent.h:42
Definition UiComponent.h:31
Definition Connector.h:8
unsigned short serviceID_t
ID type used to identify a service (16 bit unsigned integer).
Definition CoreTypes.h:14