41 class AcisBrepGeometryAdaptor;
42 class PolyToAcisConverter;
53 class ShapeTesselator;
54 class ShapeTesselator_OCC;
56 class ShapeTessellationQuality;
61 class ShapeTesselator_Acis;
62 class TriangleData_Acis;
64 class facet_body_thread_worker;
92 friend class Mesher::EdgeData;
93 friend class Mesher::EdgeData_OCC;
94 friend class Mesher::ShapeTesselator;
95 friend class Mesher::ShapeTesselator_OCC;
96 friend class MesherAcis::ShapeTesselator_Acis;
97 friend class MesherAcis::TriangleData_Acis;
98 friend class MesherAcis::EdgeData_Acis;
99 friend class MesherAcis::facet_body_thread_worker;
100 friend class Mesh::OmfMeshTool;
101 friend class Acis::AcisHelper;
102 friend class Acis::AcisBrepGeometryAdaptor;
103 friend class Acis::PolyToAcisConverter;
137 static pShape makeShape(BODY* aBody);
155 static void makeShapeAsync(
pConstBrepData data, std::function<
void(
pShape newShape, std::vector<PNTS> defectPolygons)> onShapeMadeCB);
157 static pShape makeShape(
const std::vector<int>& model,
const std::vector<Geom::Pnt>& vertices, std::vector<PNTS>& defectPolygons);
159 static pShape makeShape(
const std::vector<Base::Int>& model,
const std::vector<Geom::Pnt>& vertices, std::vector<PNTS>& defectPolygons);
161 static void makeShapeAsync(
const std::vector<int>& model,
162 const std::vector<Geom::Pnt>& vertices,
163 std::function<
void(
pShape newShape, std::vector<PNTS> defectPolygons)> onShapeMadeCB);
165 static bool makeShapes_parallel(
const std::vector<pConstBrepData>& breps, std::map<pConstBrepData, pShape>& shapes);
171 static pShape makeFaceSet(
const std::vector<pFace>& faces);
176 static pShape makeCompound(
const std::vector<pConstShape>& shapes);
208 static std::vector<int> getIndexesFromFaces(
pConstTopologicalItem item,
const std::vector<pConstFace> faces);
230 static std::vector<VisibleEdge> getEdges_visible(std::vector<pConstShape> shapes,
233 bool cam_perspective =
true);
237 static std::vector<int> getAdjacentFaceIndicesFromVertexIndex(
pConstTopologicalItem item,
int vertexIdx);
256 static bool calculateDetail(
pConstShape shape, CA_Detail& detail,
const CA_Snap& snap);
274 static void setNeedMassUpdate(
pConstShape shape,
bool on);
276 static bool write(
pConstShape shape, std::ostream& writer);
282 static bool write(
const std::string& format, std::vector<pConstShape> shapes,
const Base::String&
fileName);
285 static bool writeAcisFile(std::vector<pConstShape> shapes,
288 int major_version = -1,
289 int minor_version = -1,
293 static bool appendAcisFile(std::vector<pConstShape> shapes,
296 int major_version = -1,
297 int minor_version = -1,
300 static bool canWriteAs(
const std::string& format,
pConstShape shape);
302 static std::string getWriteFormat(
pConstShape shape);
304 static pShape read(
const std::string& format, std::istream& reader);
306 static pShape read(
const std::string& format,
const std::string& data,
float version);
308 static pShape read(
const std::string& format,
const std::string&
fileName);
316 static pShape cut(
pConstShape base,
const std::vector<pConstShape> tools,
bool* ok = 0);
335 static bool isValid(
pConstShape shape,
int checkLevel = 30);
337 static bool isValid(
pConstWire wire,
int checkLevel = 30);
339 static bool isValid(
pConstFace face,
int checkLevel = 30);
341 static bool isValid(
pConstVertex vertex,
int checkLevel = 30);
343 static bool isValid(
pConstEdge edge,
int checkLevel = 30);
351 static void getAxesOrientedSurfaces(
pConstShape shape,
double& XYSurface,
double& XZSurface,
double& YZSurface);
352 static void getVerticalAndHorizontalFaceAreas(
pConstShape shape,
353 double& verticalFaceSurface,
354 std::list<double>& verticalFaceSurfaces,
355 double& verticalLargestFaceSurface,
356 double& horizontalFaceSurface);
358 static void getVerticalAndHorizontalFaceAreas(
pConstShape shape,
360 std::list<double>& verticalFaceSurfaces,
366 static double getLargestFaceArea(
pConstShape shape);
385 static bool convertToPolygonalFaces(
pConstShape shape, std::vector<pFace>& polyFaces,
bool precise =
false);
396 static bool hasFaces(
pConstShape shape,
bool& allSubShapesHaveFaces);
398 static std::vector<pShape> getShapesFromAcisFile(
const Base::String&
fileName,
double scaleFactor = 1., std::function<
int(
int)> callback = 0);
441 static bool isExtrudedAreaSolid(
pConstShape aShape,
445 BuildingElementHintEnum aHint = BuildingElementHintEnum::NO_HINT);
466 static void releaseCdwkSATAttributes(
pConstShape shape);
469 static bool cleanupShape(
pShape shape);
482 static bool getColorRGB(
pConstShape shape,
int& r,
int& g,
int& b);
484 template <
class _InputIterator,
class _Function>
485 static void do_parallel(_InputIterator first, _InputIterator last, _Function fn)
487 while (first != last)
500 static double getModelingTolerance();
502 static void transformShape2LocalSpaceOfElement(App::Element* elem,
pShape shape);
503 static bool hasPolyHedral();
504 static bool getModelFromPolyHedral(
pShape shape, std::vector<int>& model, std::vector<Geom::Pnt>& vertices);
505 static pShape makePolyHedral(
const std::vector<int>& model,
506 const std::vector<Geom::Pnt>& vertices,
508 std::vector<std::vector<Geom::Pnt> >& defectPolygons);
509 static bool is_polyhedral_body(BODY
const* iBody);
517 #ifndef LXAPI // INTERFACES BELOW ARE -NOT- PART OF THE LEXOCAD API 519 static std::vector<Geom::Pnt> getIntersectionPoints(
pConstShape shape,
const std::vector<pConstShape> shapes);
520 static std::vector<Geom::Pnt> getAllIntersectionPoints(
const std::vector<pConstShape> shapes);
521 static void getAllIntersectionPointsIn2DMode(
const std::vector<pConstShape>& shapes,
523 const double& distance,
524 std::vector<Geom::Pnt>& intersectionPoints);
525 static void getAllIntersectionPointsWithLineIn2DMode(
const std::vector<pConstShape>& shapes,
528 std::vector<Geom::Pnt>& intersectionPoints);
530 static void getAllIntersectionPointsWithLineIn2DMode(
pConstShape shape,
533 std::vector<Geom::Pnt>& intersectionPoints);
537 static std::vector<pShape> splitLumps(
pConstShape shape);
543 static size_t getShapeCount();
544 static void shapeCountInc();
545 static void shapeCountDec();
556 static void getFacesByMaxNormalToVectorAngle(
pConstShape aShape,
557 std::map<int, Geom::Vec> aDirectionsToSortBy,
558 std::map<
int, std::vector<pConstFace> >& aFacesListMap,
559 float aMaxAngleRad = 0.75);
565 static void __setOCCShapeTool__(
Topo::ShapeTool* tool) { _occTool = tool; }
567 static void __setAcisShapeTool__(
Topo::ShapeTool* tool) { _acisTool = tool; }
569 static void __setDefaultShapeTool__(
Topo::ShapeTool* tool) { _defaultTool = tool; }
571 static void __setInventorShapeTool__(
Topo::ShapeTool* tool) { _inventorTool = tool; }
573 static void __setOMFShapeTool__(
Topo::ShapeTool* tool) { _omfTool = tool; }
575 static void __setAcisMeshShapeTool__(
Topo::ShapeTool* tool) { _acisMeshShapeTool = tool; }
577 static pConstShape getFirstShape_Helper(App::Element* elem);
585 virtual pShape _makeShape(
pWire wire,
double precision);
588 virtual pShape _makeShape(BODY* aBody);
589 virtual pShape _makeLazyFacetedBrepShape(
pConstBrepData data, std::vector<PNTS>& defectPolygons);
597 virtual pShape _makeShape(
const std::vector<pFace>& faces,
double tolerance);
598 virtual bool _makeShapes(
const std::vector<pFace>& faces, std::vector<pShape>& shapes,
double precision);
599 virtual pShape _makeShape(
const std::vector<int>& model,
600 const std::vector<Geom::Pnt>& vertices,
601 std::vector<std::vector<Geom::Pnt> >& defectPolygons);
602 virtual bool _makeShapes_parallel(
const std::vector<pConstBrepData>& breps, std::map<pConstBrepData, pShape>& shapes);
603 virtual pShape _makeFaceSet(
const std::vector<pFace>& faces);
605 virtual pShape _makeCompound(
const std::vector<pConstShape>& shapes);
627 virtual std::vector<int> _getIndexesFromFaces(
pConstTopologicalItem item,
const std::vector<pConstFace> faces);
633 virtual std::vector<int> _getAdjacentFaceIndicesFromVertexIndex(
pConstTopologicalItem item,
int vertexIdx);
639 virtual bool _calculateDetail(
pConstShape shape, CA_Detail& detail,
const CA_Snap& snap);
650 virtual void _setNeedMassUpdate(
pConstShape shape,
bool on);
651 virtual bool _write(
pConstShape shape, std::ostream& writer);
654 virtual std::string _getWriteFormat(
pConstShape shape);
657 virtual bool _write(
const std::string& format, std::vector<pConstShape> shapes,
const Base::String&
fileName);
658 virtual bool _writeAcisFile(std::vector<pConstShape> shapes,
664 virtual bool _appendAcisFile(std::vector<pConstShape> shapes,
670 virtual bool _canWriteAs(
const std::string& format,
pConstShape shape);
674 virtual pShape _cut(
pConstShape base,
const std::vector<pConstShape> tools,
bool* ok);
686 virtual bool _isValid(
pConstShape shape,
int checkLevel);
687 virtual bool _isValid(
pConstFace face,
int checkLevel);
688 virtual bool _isValid(
pConstWire wire,
int checkLevel);
689 virtual bool _isValid(
pConstVertex vertex,
int checkLevel);
690 virtual bool _isValid(
pConstEdge edge,
int checkLevel);
691 virtual bool _isValid(
pShape shape,
int checkLevel);
692 virtual bool _isValid(
pFace face,
int checkLevel);
693 virtual bool _isValid(
pWire wire,
int checkLevel);
694 virtual bool _isValid(
pVertex vertex,
int checkLevel);
695 virtual bool _isValid(
pEdge edge,
int checkLevel);
698 virtual bool _cleanupShape(
pShape shape);
701 virtual void _getAxesOrientedSurfaces(
pConstShape shape,
double& XYSurface,
double& XZSurface,
double& YZSurface);
702 virtual void _getVerticalAndHorizontalFaceAreas(
pConstShape shape,
703 double& verticalFaceSurface,
704 std::list<double>& verticalFaceSurfaces,
705 double& verticalLargestFaceSurface,
706 double& horizontalFaceSurface);
715 virtual bool _convertToPolygonalFaces(
pConstShape shape, std::vector<pFace>& polyFaces,
bool precise =
false);
718 virtual std::vector<Geom::Pnt> _getIntersectionPoints(
pConstShape shape,
const std::vector<pConstShape> shapes);
719 virtual std::vector<Geom::Pnt> _getAllIntersectionPoints(
const std::vector<pConstShape> shapes);
724 virtual std::vector<pShape> _splitLumps(
pConstShape shape);
726 virtual bool _hasFaces(
pConstShape shape,
bool& allSubShapesHaveFaces);
729 virtual std::vector<pShape> _getShapesFromAcisFile(
const Base::String&
fileName,
double scaleFactor = 1., std::function<
int(
int)> callback = 0);
737 virtual std::vector<VisibleEdge> _getEdges_visible(std::vector<pConstShape> shapes,
740 bool cam_perspective =
true);
743 App::Element*& newElement,
744 App::Element* sample = 0);
750 virtual bool _getColorRGB(
pConstShape shape,
int& r,
int& g,
int& b);
757 errorInfo = L
"Not implemented";
762 errorInfo = L
"Not implemented";
766 virtual double _getModelingTolerance();
781 virtual void _releaseCdwkSATAttributes(
pConstShape shape) {}
782 virtual void _transformShape2LocalSpaceOfElement(App::Element* elem,
pShape shape);
786 virtual bool _hasPolyHedral();
787 virtual bool _getModelFromPolyHedral(
pShape shape, std::vector<int>& model, std::vector<Geom::Pnt>& vertices);
788 virtual pShape _makePolyHedral(
const std::vector<int>& model,
789 const std::vector<Geom::Pnt>& vertices,
791 std::vector<std::vector<Geom::Pnt> >& defectPolygons);
792 virtual bool _is_polyhedral_body(BODY
const* iBody);
807 static size_t _shapeCount;
std::shared_ptr< Topo::Wire const > pConstWire
Definition: Shape.h:98
std::shared_ptr< Topo::Solid const > pConstSolid
Definition: Shape.h:95
std::shared_ptr< Topo::Solid > pSolid
Definition: Shape.h:80
std::shared_ptr< Topo::Compound > pCompound
Definition: Shape.h:79
#define TOPO_EXPORT
Definition: topo_defines.h:8
Defines a non-persistent 3D Cartesian point.
Definition: Pnt.h:42
std::shared_ptr< Topo::Vertex > pVertex
Definition: Shape.h:86
std::shared_ptr< Topo::Edge const > pConstEdge
Definition: Shape.h:99
std::shared_ptr< Topo::TopologicalItem const > pConstTopologicalItem
Definition: Shape.h:90
static const double linear_Resolution()
Definition: Precision.h:26
Core::PropertyText name
Definition: CoreDocument.h:143
Definition: ShapeInfo.h:8
Definition: FaceTool.h:24
std::shared_ptr< Topo::Face const > pConstFace
Definition: Shape.h:97
std::shared_ptr< Geom::BrepData > pBrepData
Definition: BrepData.h:34
std::shared_ptr< Topo::Face > pFace
Definition: Shape.h:82
A Utf-16 (windows) or ucs4 (unix) encoded string class.
Definition: String.h:29
LX_CORE_EXPORT Version & version
Definition: CoreDocument.h:197
std::vector< RayHit > RayHitVector
Definition: RayHit.h:45
std::shared_ptr< Topo::Shell const > pConstShell
Definition: Shape.h:96
Definition: SimplifyOptions.h:7
std::shared_ptr< const Geom::BrepData > pConstBrepData
Definition: BrepData.h:37
Core::PropertyText filename
Definition: CoreDocument.h:151
std::shared_ptr< Geom::IndexedMesh > pIndexedMesh
Definition: IndexedMesh.h:59
std::shared_ptr< Topo::MeshShape > pMesh
Definition: Shape.h:78
Definition: ShapeAttributes.h:24
Definition: NurbsOptions.h:192
Definition: GlobalAttachment.h:11
std::shared_ptr< Topo::Vertex const > pConstVertex
Definition: Shape.h:101
Definition: NurbsOptions.h:18
std::shared_ptr< Topo::Compound const > pConstCompound
Definition: Shape.h:94
std::shared_ptr< Topo::Wire > pWire
Definition: Shape.h:83
BodyClashType
Definition: Clash.h:5
Definition: ThreadTask.h:36
std::shared_ptr< Topo::Shape const > pConstShape
Definition: Variant.h:81
std::shared_ptr< Topo::MeshShape const > pConstMesh
Definition: Shape.h:93
ClashMode
Definition: Clash.h:17
Base::String fileName
Definition: CoreDocument.h:161
virtual bool restoreGlobalAttachment(Base::GlobalAttachment *gAtta, std::istream *, uint64_t streamsize, const Base::String &entryName)
Definition: DocObject.h:28
std::shared_ptr< Topo::Shape > pShape
Definition: Variant.h:80
std::shared_ptr< Topo::Edge > pEdge
Definition: Shape.h:84