Go to the documentation of this file.
6 #include <Geom/Bnd_box.h>
15 namespace Base {
struct Double; }
16 namespace Base {
struct Int; }
17 namespace Core {
class DocObject; }
18 namespace Geom {
class Ax2; }
19 namespace Geom {
class Dir; }
20 namespace Geom {
class GTrsf; }
21 namespace Geom {
class Pln; }
22 namespace Geom {
class Vec; }
32 class GlobalAttachment;
39 class AcisBrepGeometryAdaptor;
40 class PolyToAcisConverter;
51 class ShapeTesselator;
52 class ShapeTesselator_OCC;
58 class ShapeTesselator_Acis;
59 class TriangleData_Acis;
61 class facet_body_thread_worker;
78 typedef std::vector<Geom::Pnt>
PNTS;
82 class SkinningOptions;
83 class SweepingOptions;
86 class Cdwk_SAT_Attributes;
88 class SimplifyOptions;
103 friend class Mesher::EdgeData;
104 friend class Mesher::EdgeData_OCC;
105 friend class Mesher::ShapeTesselator;
106 friend class Mesher::ShapeTesselator_OCC;
107 friend class MesherAcis::ShapeTesselator_Acis;
108 friend class MesherAcis::TriangleData_Acis;
109 friend class MesherAcis::EdgeData_Acis;
110 friend class MesherAcis::facet_body_thread_worker;
111 friend class Mesh::OmfMeshTool;
112 friend class Acis::AcisHelper;
113 friend class Acis::AcisBrepGeometryAdaptor;
114 friend class Acis::PolyToAcisConverter;
168 static pShape makeShape(
const std::vector<int>& model,
const std::vector<Geom::Pnt>& vertices, std::vector<PNTS>& defectPolygons);
170 static pShape makeShape(
const std::vector<Base::Int>& model,
const std::vector<Geom::Pnt>& vertices, std::vector<PNTS>& defectPolygons);
173 const std::vector<Geom::Pnt>& vertices,
174 std::function<
void(
pShape newShape, std::vector<PNTS> defectPolygons)> onShapeMadeCB);
176 static bool makeShapes_parallel(
const std::vector<pConstBrepData>& breps, std::map<pConstBrepData, pShape>& shapes);
244 bool cam_perspective =
true);
295 static bool write(
const std::string& format, std::vector<pConstShape> shapes,
const Base::String& fileName);
301 int major_version = -1,
302 int minor_version = -1,
309 int major_version = -1,
310 int minor_version = -1,
317 static pShape read(
const std::string& format, std::istream& reader);
321 static pShape read(
const std::string& format,
const std::string& fileName);
368 double& verticalFaceSurface,
369 std::vector<double>& verticalFaceSurfaces,
370 double& verticalLargestFaceSurface,
371 double& horizontalFaceSurface);
375 std::vector<double>& verticalFaceSurfaces,
501 template <
class _InputIterator,
class _Function>
502 static void do_parallel(_InputIterator first, _InputIterator last, _Function fn)
504 while (first != last)
523 const std::vector<Geom::Pnt>& vertices,
525 std::vector<std::vector<Geom::Pnt> >& defectPolygons);
534 #ifndef LXAPI // INTERFACES BELOW ARE -NOT- PART OF THE LEXOCAD API
541 std::vector<Geom::Pnt>& intersectionPoints);
545 std::vector<Geom::Pnt>& intersectionPoints);
550 std::vector<Geom::Pnt>& intersectionPoints);
574 std::map<int, Geom::Vec> aDirectionsToSortBy,
575 std::map<
int, std::vector<pConstFace> >& aFacesListMap,
576 float aMaxAngleRad = 0.75);
588 static void __setOCCShapeTool__(
Topo::ShapeTool* tool) { _occTool = tool; }
590 static void __setAcisShapeTool__(
Topo::ShapeTool* tool) { _acisTool = tool; }
592 static void __setDefaultShapeTool__(
Topo::ShapeTool* tool) { _defaultTool = tool; }
594 static void __setInventorShapeTool__(
Topo::ShapeTool* tool) { _inventorTool = tool; }
596 static void __setOMFShapeTool__(
Topo::ShapeTool* tool) { _omfTool = tool; }
598 static void __setAcisMeshShapeTool__(
Topo::ShapeTool* tool) { _acisMeshShapeTool = tool; }
600 static pConstShape getFirstShape_Helper(App::Element* elem);
610 virtual pShape _makeShape(
pWire wire,
double precision);
613 virtual pShape _makeShape(BODY* aBody);
614 virtual pShape _makeLazyFacetedBrepShape(
pConstBrepData data, std::vector<PNTS>& defectPolygons);
622 virtual pShape _makeShape(
const std::vector<pFace>& faces,
double tolerance);
623 virtual bool _makeShapes(
const std::vector<pFace>& faces, std::vector<pShape>& shapes,
double precision);
624 virtual pShape _makeShape(
const std::vector<int>& model,
625 const std::vector<Geom::Pnt>& vertices,
626 std::vector<std::vector<Geom::Pnt> >& defectPolygons);
627 virtual bool _makeShapes_parallel(
const std::vector<pConstBrepData>& breps, std::map<pConstBrepData, pShape>& shapes);
628 virtual pShape _makeFaceSet(
const std::vector<pFace>& faces);
630 virtual pShape _makeCompound(
const std::vector<pConstShape>& shapes);
652 virtual std::vector<int> _getIndexesFromFaces(
pConstTopologicalItem item,
const std::vector<pConstFace> faces);
658 virtual std::vector<int> _getAdjacentFaceIndicesFromVertexIndex(
pConstTopologicalItem item,
int vertexIdx);
664 virtual bool _calculateDetail(
pConstShape shape, CA_Detail& detail,
const CA_Snap& snap);
676 virtual void _setNeedMassUpdate(
pConstShape shape,
bool on);
678 virtual bool _write(
pConstShape shape, std::ostream& writer);
681 virtual std::string _getWriteFormat(
pConstShape shape);
684 virtual bool _write(
const std::string& format, std::vector<pConstShape> shapes,
const Base::String& fileName);
685 virtual bool _writeAcisFile(std::vector<pConstShape> shapes,
691 virtual bool _appendAcisFile(std::vector<pConstShape> shapes,
697 virtual bool _canWriteAs(
const std::string& format,
pConstShape shape);
701 virtual pShape _cut(
pConstShape base,
const std::vector<pConstShape> tools,
bool* ok);
714 virtual bool _isValid(
pConstShape shape,
int checkLevel);
715 virtual bool _isValid(
pConstFace face,
int checkLevel);
716 virtual bool _isValid(
pConstWire wire,
int checkLevel);
717 virtual bool _isValid(
pConstVertex vertex,
int checkLevel);
718 virtual bool _isValid(
pConstEdge edge,
int checkLevel);
719 virtual bool _isValid(
pShape shape,
int checkLevel);
720 virtual bool _isValid(
pFace face,
int checkLevel);
721 virtual bool _isValid(
pWire wire,
int checkLevel);
722 virtual bool _isValid(
pVertex vertex,
int checkLevel);
723 virtual bool _isValid(
pEdge edge,
int checkLevel);
726 virtual bool _cleanupShape(
pShape shape);
729 virtual void _getAxesOrientedSurfaces(
pConstShape shape,
double& XYSurface,
double& XZSurface,
double& YZSurface);
730 virtual void _getVerticalAndHorizontalFaceAreas(
pConstShape shape,
731 double& verticalFaceSurface,
732 std::vector<double>& verticalFaceSurfaces,
733 double& verticalLargestFaceSurface,
734 double& horizontalFaceSurface);
743 virtual bool _convertToPolygonalFaces(
pConstShape shape, std::vector<pFace>& polyFaces,
bool precise =
false);
746 virtual std::vector<Geom::Pnt> _getIntersectionPoints(
pConstShape shape,
const std::vector<pConstShape> shapes);
747 virtual std::vector<Geom::Pnt> _getAllIntersectionPoints(
const std::vector<pConstShape> shapes);
752 virtual std::vector<pShape> _splitLumps(
pConstShape shape);
754 virtual bool _hasFaces(
pConstShape shape,
bool& allSubShapesHaveFaces);
757 virtual std::vector<pShape> _getShapesFromAcisFile(
const Base::String& fileName,
double scaleFactor = 1., std::function<
int(
int)> callback = 0);
765 virtual std::vector<VisibleEdge> _getEdges_visible(std::vector<pConstShape> shapes,
768 bool cam_perspective =
true);
771 App::Element*& newElement,
772 App::Element* sample = 0);
778 virtual bool _getColorRGB(
pConstShape shape,
int& r,
int& g,
int& b);
785 errorInfo = L
"Not implemented";
790 errorInfo = L
"Not implemented";
794 virtual double _getModelingTolerance();
809 virtual void _releaseCdwkSATAttributes(
pConstShape shape) {}
810 virtual void _transformShape2LocalSpaceOfElement(App::Element* elem,
pShape shape);
814 virtual bool _hasPolyHedral();
815 virtual bool _getModelFromPolyHedral(
pShape shape, std::vector<int>& model, std::vector<Geom::Pnt>& vertices);
816 virtual pShape _makePolyHedral(
const std::vector<int>& model,
817 const std::vector<Geom::Pnt>& vertices,
819 std::vector<std::vector<Geom::Pnt> >& defectPolygons);
820 virtual bool _is_polyhedral_body(BODY
const* iBody);
822 virtual bool _getEntityAttribute_Int(ENTITY* ent,
int& v);
823 virtual bool _setEntityAttribute_Int(ENTITY* ent,
int v);
839 static size_t _shapeCount;
std::shared_ptr< Topo::Shell const > pConstShell
Definition: Types.h:69
std::shared_ptr< Topo::Vertex const > pConstVertex
Definition: Types.h:74
Definition: CoreDocument.h:269
void transform(Container container, OutputIt out, BinaryFunction function)
Definition: Algorithms.h:30
Definition: ShapeInfo.h:7
std::shared_ptr< Topo::Solid const > pConstSolid
Definition: Types.h:68
std::shared_ptr< Topo::Wire const > pConstWire
Definition: Types.h:71
std::shared_ptr< Geom::BrepData > pBrepData
Definition: PropertyBrepData.h:5
Definition: NurbsOptions.h:21
std::shared_ptr< Topo::Face > pFace
Definition: Types.h:53
std::shared_ptr< Topo::Shape const > pConstShape
Definition: Variant.h:65
Definition: ShapeAttributes.h:20
Definition: DocObject.h:54
std::shared_ptr< Topo::Shape > pShape
Definition: Variant.h:64
std::shared_ptr< Topo::Edge > pEdge
Definition: Types.h:55
std::shared_ptr< Topo::Wire > pWire
Definition: Types.h:54
std::shared_ptr< Topo::Compound const > pConstCompound
Definition: Types.h:67
std::shared_ptr< Topo::Compound > pCompound
Definition: Types.h:50
std::shared_ptr< Topo::MeshShape > pMesh
Definition: Types.h:49
std::shared_ptr< Topo::Face const > pConstFace
Definition: Types.h:70
std::shared_ptr< Topo::Solid > pSolid
Definition: Types.h:51
Definition: ShapeTessellationQuality.h:7
std::shared_ptr< Topo::Vertex > pVertex
Definition: Types.h:57
Definition: FaceTool.h:21
Definition: NurbsOptions.h:189
Defines a non-persistent 3D Cartesian point.
Definition: Pnt.h:44
std::vector< RayHit > RayHitVector
Definition: RayHit.h:45
std::shared_ptr< Geom::IndexedMesh > pIndexedMesh
Definition: IndexedMesh.h:59
BodyClashType
Definition: Clash.h:6
Definition: SimplifyOptions.h:7
double distance(const Geom::Vec &v1, const Geom::Vec &v2)
Returns the distance between two points.
Definition: Vec.h:341
std::shared_ptr< const Geom::BrepData > pConstBrepData
Definition: BrepData.h:31
std::shared_ptr< Topo::MeshShape const > pConstMesh
Definition: Types.h:66
std::shared_ptr< Topo::Edge const > pConstEdge
Definition: Types.h:72
ClashMode
Definition: Clash.h:18
LX_CORE_EXPORT Version & version
std::shared_ptr< Topo::TopologicalItem const > pConstTopologicalItem
Definition: Types.h:63
Definition: GlobalAttachment.h:8
A Utf-16 (windows) or ucs4 (unix) encoded string class.
Definition: String.h:18
Definition: ThreadTask.h:36
static constexpr double linear_Resolution()
Definition: Precision.h:23
Definition: AbstractXMLReader.h:5
Definition: PropertyContainer.h:33