40 class AcisBrepGeometryAdaptor;
41 class PolyToAcisConverter;
52 class ShapeTesselator;
53 class ShapeTesselator_OCC;
55 class ShapeTessellationQuality;
60 class ShapeTesselator_Acis;
61 class TriangleData_Acis;
63 class facet_body_thread_worker;
91 friend class Mesher::EdgeData;
92 friend class Mesher::EdgeData_OCC;
93 friend class Mesher::ShapeTesselator;
94 friend class Mesher::ShapeTesselator_OCC;
95 friend class MesherAcis::ShapeTesselator_Acis;
96 friend class MesherAcis::TriangleData_Acis;
97 friend class MesherAcis::EdgeData_Acis;
98 friend class MesherAcis::facet_body_thread_worker;
99 friend class Mesh::OmfMeshTool;
100 friend class Acis::AcisHelper;
101 friend class Acis::AcisBrepGeometryAdaptor;
102 friend class Acis::PolyToAcisConverter;
136 static pShape makeShape(BODY* aBody);
154 static void makeShapeAsync(
pConstBrepData data, std::function<
void(
pShape newShape, std::vector<PNTS> defectPolygons)> onShapeMadeCB);
156 static pShape makeShape(
const std::vector<int>& model,
const std::vector<Geom::Pnt>& vertices, std::vector<PNTS>& defectPolygons);
158 static pShape makeShape(
const std::vector<Base::Int>& model,
const std::vector<Geom::Pnt>& vertices, std::vector<PNTS>& defectPolygons);
160 static void makeShapeAsync(
const std::vector<int>& model,
161 const std::vector<Geom::Pnt>& vertices,
162 std::function<
void(
pShape newShape, std::vector<PNTS> defectPolygons)> onShapeMadeCB);
164 static bool makeShapes_parallel(
const std::vector<pConstBrepData>& breps, std::map<pConstBrepData, pShape>& shapes);
170 static pShape makeFaceSet(
const std::vector<pFace>& faces);
175 static pShape makeCompound(
const std::vector<pConstShape>& shapes);
207 static std::vector<int> getIndexesFromFaces(
pConstTopologicalItem item,
const std::vector<pConstFace> faces);
229 static std::vector<VisibleEdge> getEdges_visible(std::vector<pConstShape> shapes,
232 bool cam_perspective =
true);
236 static std::vector<int> getAdjacentFaceIndicesFromVertexIndex(
pConstTopologicalItem item,
int vertexIdx);
255 static bool calculateDetail(
pConstShape shape, CA_Detail& detail,
const CA_Snap& snap);
273 static void setNeedMassUpdate(
pConstShape shape,
bool on);
275 static bool write(
pConstShape shape, std::ostream& writer);
281 static bool write(
const std::string& format, std::vector<pConstShape> shapes,
const Base::String&
fileName);
284 static bool writeAcisFile(std::vector<pConstShape> shapes,
287 int major_version = -1,
288 int minor_version = -1,
292 static bool appendAcisFile(std::vector<pConstShape> shapes,
295 int major_version = -1,
296 int minor_version = -1,
299 static bool canWriteAs(
const std::string& format,
pConstShape shape);
301 static std::string getWriteFormat(
pConstShape shape);
303 static pShape read(
const std::string& format, std::istream& reader);
305 static pShape read(
const std::string& format,
const std::string& data,
float version);
307 static pShape read(
const std::string& format,
const std::string&
fileName);
315 static pShape cut(
pConstShape base,
const std::vector<pConstShape> tools,
bool* ok = 0);
334 static bool isValid(
pConstShape shape,
int checkLevel = 30);
336 static bool isValid(
pConstWire wire,
int checkLevel = 30);
338 static bool isValid(
pConstFace face,
int checkLevel = 30);
340 static bool isValid(
pConstVertex vertex,
int checkLevel = 30);
342 static bool isValid(
pConstEdge edge,
int checkLevel = 30);
350 static void getAxesOrientedSurfaces(
pConstShape shape,
double& XYSurface,
double& XZSurface,
double& YZSurface);
351 static void getVerticalAndHorizontalFaceAreas(
pConstShape shape,
352 double& verticalFaceSurface,
353 std::vector<double>& verticalFaceSurfaces,
354 double& verticalLargestFaceSurface,
355 double& horizontalFaceSurface);
357 static void getVerticalAndHorizontalFaceAreas(
pConstShape shape,
359 std::vector<double>& verticalFaceSurfaces,
363 static double getAreaFromTop(
pConstShape shape,
pMesh * areFromTopMesh =
nullptr);
365 static double getLargestFaceArea(
pConstShape shape);
384 static bool convertToPolygonalFaces(
pConstShape shape, std::vector<pFace>& polyFaces,
bool precise =
false);
395 static bool hasFaces(
pConstShape shape,
bool& allSubShapesHaveFaces);
397 static std::vector<pShape> getShapesFromAcisFile(
const Base::String&
fileName,
double scaleFactor = 1., std::function<
int(
int)> callback = 0);
440 static bool isExtrudedAreaSolid(
pConstShape aShape,
444 BuildingElementHintEnum aHint = BuildingElementHintEnum::NO_HINT);
465 static void releaseCdwkSATAttributes(
pConstShape shape);
468 static bool cleanupShape(
pShape shape);
481 static bool getColorRGB(
pConstShape shape,
int& r,
int& g,
int& b);
483 template <
class _InputIterator,
class _Function>
484 static void do_parallel(_InputIterator first, _InputIterator last, _Function fn)
486 while (first != last)
499 static double getModelingTolerance();
501 static void transformShape2LocalSpaceOfElement(App::Element* elem,
pShape shape);
502 static bool hasPolyHedral();
503 static bool getModelFromPolyHedral(
pShape shape, std::vector<int>& model, std::vector<Geom::Pnt>& vertices);
504 static pShape makePolyHedral(
const std::vector<int>& model,
505 const std::vector<Geom::Pnt>& vertices,
507 std::vector<std::vector<Geom::Pnt> >& defectPolygons);
508 static bool is_polyhedral_body(BODY
const* iBody);
516 #ifndef LXAPI // INTERFACES BELOW ARE -NOT- PART OF THE LEXOCAD API 518 static std::vector<Geom::Pnt> getIntersectionPoints(
pConstShape shape,
const std::vector<pConstShape> shapes);
519 static std::vector<Geom::Pnt> getAllIntersectionPoints(
const std::vector<pConstShape> shapes);
520 static void getAllIntersectionPointsIn2DMode(
const std::vector<pConstShape>& shapes,
523 std::vector<Geom::Pnt>& intersectionPoints);
524 static void getAllIntersectionPointsWithLineIn2DMode(
const std::vector<pConstShape>& shapes,
527 std::vector<Geom::Pnt>& intersectionPoints);
529 static void getAllIntersectionPointsWithLineIn2DMode(
pConstShape shape,
532 std::vector<Geom::Pnt>& intersectionPoints);
536 static std::vector<pShape> splitLumps(
pConstShape shape);
542 static size_t getShapeCount();
543 static void shapeCountInc();
544 static void shapeCountDec();
555 static void getFacesByMaxNormalToVectorAngle(
pConstShape aShape,
556 std::map<int, Geom::Vec> aDirectionsToSortBy,
557 std::map<
int, std::vector<pConstFace> >& aFacesListMap,
558 float aMaxAngleRad = 0.75);
562 static bool getEntityAttribute_Int(ENTITY* ent,
int& v);
563 static bool setEntityAttribute_Int(ENTITY* ent,
int v);
567 static void __setOCCShapeTool__(
Topo::ShapeTool* tool) { _occTool = tool; }
569 static void __setAcisShapeTool__(
Topo::ShapeTool* tool) { _acisTool = tool; }
571 static void __setDefaultShapeTool__(
Topo::ShapeTool* tool) { _defaultTool = tool; }
573 static void __setInventorShapeTool__(
Topo::ShapeTool* tool) { _inventorTool = tool; }
575 static void __setOMFShapeTool__(
Topo::ShapeTool* tool) { _omfTool = tool; }
577 static void __setAcisMeshShapeTool__(
Topo::ShapeTool* tool) { _acisMeshShapeTool = tool; }
579 static pConstShape getFirstShape_Helper(App::Element* elem);
587 virtual pShape _makeShape(
pWire wire,
double precision);
590 virtual pShape _makeShape(BODY* aBody);
591 virtual pShape _makeLazyFacetedBrepShape(
pConstBrepData data, std::vector<PNTS>& defectPolygons);
599 virtual pShape _makeShape(
const std::vector<pFace>& faces,
double tolerance);
600 virtual bool _makeShapes(
const std::vector<pFace>& faces, std::vector<pShape>& shapes,
double precision);
601 virtual pShape _makeShape(
const std::vector<int>& model,
602 const std::vector<Geom::Pnt>& vertices,
603 std::vector<std::vector<Geom::Pnt> >& defectPolygons);
604 virtual bool _makeShapes_parallel(
const std::vector<pConstBrepData>& breps, std::map<pConstBrepData, pShape>& shapes);
605 virtual pShape _makeFaceSet(
const std::vector<pFace>& faces);
607 virtual pShape _makeCompound(
const std::vector<pConstShape>& shapes);
629 virtual std::vector<int> _getIndexesFromFaces(
pConstTopologicalItem item,
const std::vector<pConstFace> faces);
635 virtual std::vector<int> _getAdjacentFaceIndicesFromVertexIndex(
pConstTopologicalItem item,
int vertexIdx);
641 virtual bool _calculateDetail(
pConstShape shape, CA_Detail& detail,
const CA_Snap& snap);
652 virtual void _setNeedMassUpdate(
pConstShape shape,
bool on);
653 virtual bool _write(
pConstShape shape, std::ostream& writer);
656 virtual std::string _getWriteFormat(
pConstShape shape);
659 virtual bool _write(
const std::string& format, std::vector<pConstShape> shapes,
const Base::String&
fileName);
660 virtual bool _writeAcisFile(std::vector<pConstShape> shapes,
666 virtual bool _appendAcisFile(std::vector<pConstShape> shapes,
672 virtual bool _canWriteAs(
const std::string& format,
pConstShape shape);
676 virtual pShape _cut(
pConstShape base,
const std::vector<pConstShape> tools,
bool* ok);
688 virtual bool _isValid(
pConstShape shape,
int checkLevel);
689 virtual bool _isValid(
pConstFace face,
int checkLevel);
690 virtual bool _isValid(
pConstWire wire,
int checkLevel);
691 virtual bool _isValid(
pConstVertex vertex,
int checkLevel);
692 virtual bool _isValid(
pConstEdge edge,
int checkLevel);
693 virtual bool _isValid(
pShape shape,
int checkLevel);
694 virtual bool _isValid(
pFace face,
int checkLevel);
695 virtual bool _isValid(
pWire wire,
int checkLevel);
696 virtual bool _isValid(
pVertex vertex,
int checkLevel);
697 virtual bool _isValid(
pEdge edge,
int checkLevel);
700 virtual bool _cleanupShape(
pShape shape);
703 virtual void _getAxesOrientedSurfaces(
pConstShape shape,
double& XYSurface,
double& XZSurface,
double& YZSurface);
704 virtual void _getVerticalAndHorizontalFaceAreas(
pConstShape shape,
705 double& verticalFaceSurface,
706 std::vector<double>& verticalFaceSurfaces,
707 double& verticalLargestFaceSurface,
708 double& horizontalFaceSurface);
717 virtual bool _convertToPolygonalFaces(
pConstShape shape, std::vector<pFace>& polyFaces,
bool precise =
false);
720 virtual std::vector<Geom::Pnt> _getIntersectionPoints(
pConstShape shape,
const std::vector<pConstShape> shapes);
721 virtual std::vector<Geom::Pnt> _getAllIntersectionPoints(
const std::vector<pConstShape> shapes);
726 virtual std::vector<pShape> _splitLumps(
pConstShape shape);
728 virtual bool _hasFaces(
pConstShape shape,
bool& allSubShapesHaveFaces);
731 virtual std::vector<pShape> _getShapesFromAcisFile(
const Base::String&
fileName,
double scaleFactor = 1., std::function<
int(
int)> callback = 0);
739 virtual std::vector<VisibleEdge> _getEdges_visible(std::vector<pConstShape> shapes,
742 bool cam_perspective =
true);
745 App::Element*& newElement,
746 App::Element* sample = 0);
752 virtual bool _getColorRGB(
pConstShape shape,
int& r,
int& g,
int& b);
759 errorInfo = L
"Not implemented";
764 errorInfo = L
"Not implemented";
768 virtual double _getModelingTolerance();
783 virtual void _releaseCdwkSATAttributes(
pConstShape shape) {}
784 virtual void _transformShape2LocalSpaceOfElement(App::Element* elem,
pShape shape);
788 virtual bool _hasPolyHedral();
789 virtual bool _getModelFromPolyHedral(
pShape shape, std::vector<int>& model, std::vector<Geom::Pnt>& vertices);
790 virtual pShape _makePolyHedral(
const std::vector<int>& model,
791 const std::vector<Geom::Pnt>& vertices,
793 std::vector<std::vector<Geom::Pnt> >& defectPolygons);
794 virtual bool _is_polyhedral_body(BODY
const* iBody);
796 virtual bool _getEntityAttribute_Int(ENTITY* ent,
int& v);
797 virtual bool _setEntityAttribute_Int(ENTITY* ent,
int v);
811 static size_t _shapeCount;
std::shared_ptr< Topo::Wire const > pConstWire
Definition: Shape.h:97
std::shared_ptr< Topo::Solid const > pConstSolid
Definition: Shape.h:94
std::shared_ptr< Topo::Solid > pSolid
Definition: Shape.h:79
std::shared_ptr< Topo::Compound > pCompound
Definition: Shape.h:78
Defines a non-persistent 3D Cartesian point.
Definition: Pnt.h:43
std::shared_ptr< Topo::Vertex > pVertex
Definition: Shape.h:85
std::shared_ptr< Topo::Edge const > pConstEdge
Definition: Shape.h:98
std::shared_ptr< Topo::TopologicalItem const > pConstTopologicalItem
Definition: Shape.h:89
static const double linear_Resolution()
Definition: Precision.h:24
Core::PropertyText name
Definition: CoreDocument.h:167
Definition: ShapeInfo.h:6
Definition: FaceTool.h:24
std::shared_ptr< Topo::Face const > pConstFace
Definition: Shape.h:96
std::shared_ptr< Geom::BrepData > pBrepData
Definition: BrepData.h:28
std::shared_ptr< Topo::Face > pFace
Definition: Shape.h:81
A Utf-16 (windows) or ucs4 (unix) encoded string class.
Definition: String.h:23
LX_CORE_EXPORT Version & version
Definition: CoreDocument.h:210
std::vector< RayHit > RayHitVector
Definition: RayHit.h:44
std::shared_ptr< Topo::Shell const > pConstShell
Definition: Shape.h:95
Definition: SimplifyOptions.h:5
std::shared_ptr< const Geom::BrepData > pConstBrepData
Definition: BrepData.h:31
Core::PropertyText filename
Definition: CoreDocument.h:176
std::shared_ptr< Geom::IndexedMesh > pIndexedMesh
Definition: IndexedMesh.h:55
std::shared_ptr< Topo::MeshShape > pMesh
Definition: Shape.h:77
Definition: ShapeAttributes.h:23
Definition: NurbsOptions.h:191
Definition: GlobalAttachment.h:10
std::shared_ptr< Topo::Vertex const > pConstVertex
Definition: Shape.h:100
Definition: NurbsOptions.h:17
std::shared_ptr< Topo::Compound const > pConstCompound
Definition: Shape.h:93
double distance(const Geom::Vec &v1, const Geom::Vec &v2)
Returns the distance between two points.
Definition: Vec.h:345
std::shared_ptr< Topo::Wire > pWire
Definition: Shape.h:82
BodyClashType
Definition: Clash.h:5
Definition: ThreadTask.h:34
std::shared_ptr< Topo::Shape const > pConstShape
Definition: Variant.h:77
std::shared_ptr< Topo::MeshShape const > pConstMesh
Definition: Shape.h:92
ClashMode
Definition: Clash.h:17
Base::String fileName
Definition: CoreDocument.h:186
virtual bool restoreGlobalAttachment(Base::GlobalAttachment *gAtta, std::istream *, uint64_t streamsize, const Base::String &entryName)
Definition: DocObject.h:51
std::shared_ptr< Topo::Shape > pShape
Definition: Variant.h:76
std::shared_ptr< Topo::Edge > pEdge
Definition: Shape.h:83