Skip to content

Topology Module

Shape representation and topological operations.

LightOcct::LShape

Light OCCT wrapper for TopoDS_Shape with enum + Handle pattern.

Provides type-safe topology storage using OCCT TopoDS_Shape internally. Follows Light OCCT architectural patterns: Enum + Handle pattern for type-safe storage POD structures for cross-language data exchange Wrapper methods using only Light OCCT types No OCCT types exposed in public interface Shape hierarchy (complex to simple): COMPOUND: Group of any shapes COMPSOLID: Connected solids SOLID: 3D bounded region SHELL: Connected faces FACE: Bounded surface WIRE: Connected edges EDGE: Bounded curve VERTEX: Point

cpp
#include <light-occt/topology/LShape.hxx>

Quick Reference

Fields: myType

Factory Methods: CreateVertex(), CreateEdge(), CreateEdge(), CreateWire(), CreateFace(), CreateFace(), CreateFaceFromWire(), CreateFaceFromWires(), CreateTriangularFace(), CreateRectangularFace(), CreatePolygonalFace(), CreateFaceFromTriangulation(), CreateEdgeFromPoints(), CreateEdgeFromVertices(), CreatePolylineEdge(), CreateArcEdge(), CreateArcEdgeThrough3Points(), CreateWireFromEdges(), CreateRectangularWire(), CreatePolygonalWire(), CreateShell(), CreateSolid(), CreateCompound()

Methods: GetType(), IsValid(), IsCompound(), IsCompSolid(), IsSolid(), IsShell(), IsFace(), IsWire(), IsEdge(), IsVertex(), LShape(), ~LShape(), LShape(), operator=(), GetShapeData(), GetVertexData(), GetEdgeData(), GetFaceData(), GetCurve(), GetCurve(), GetSurface(), GetSurface(), GetNbChildren(), IsNull(), IsEqual(), IsSame(), IsPartner(), Transform(), Transformed(), Move(), Moved(), GetOrientation(), SetOrientation(), Oriented(), Reverse(), Reversed(), Complement(), Complemented(), GetFlags(), SetFlags(), IsFree(), SetFree(), IsLocked(), SetLocked(), IsModified(), SetModified(), Nullify(), HashCode(), AddSubShape(), RemoveSubShape(), CanAddSubShape(), ContainsSubShape(), ClearSubShapes(), GetSubShapes(), GetSubShapeCount(), GetTriangulation(), GetPolygon3d()

Enums: ShapeTypeEnum

Types: TypeEnum


Fields

myType

cpp
ShapeTypeEnum myType;

Methods

Factory Methods

CreateVertex

Create vertex shape from point.

cpp
static LShape CreateVertex(const  & Point point, double tolerance);

point 3D point position tolerance Geometric tolerance (default: 1e-7) Vertex shape

Parameters:

  • point - 3D point position tolerance Geometric tolerance (default: 1e-7) Vertex shape
  • tolerance - Geometric tolerance (default: 1e-7) Vertex shape
CreateEdge

Create edge shape from curve.

cpp
static LShape CreateEdge(const  & LCurve curve, double tolerance);

curve 3D curve geometry firstParam Start parameter on curve (optional, uses curve bounds if not specified) lastParam End parameter on curve (optional, uses curve bounds if not specified) tolerance Geometric tolerance (default: 1e-7) Edge shape

Parameters:

  • curve - 3D curve geometry firstParam Start parameter on curve (optional, uses curve bounds if not specified) lastParam End parameter on curve (optional, uses curve bounds if not specified) tolerance Geometric tolerance (default: 1e-7) Edge shape
  • tolerance - Geometric tolerance (default: 1e-7) Edge shape
CreateEdge
cpp
static LShape CreateEdge(const  & LCurve curve, double firstParam, double lastParam, double tolerance);
CreateWire

Create wire shape from collection of edges.

cpp
static LShape CreateWire();

Empty wire shape (edges can be added using builder methods)

CreateFace

Create face shape from surface.

cpp
static LShape CreateFace(const  & LSurface surface, double tolerance);

surface 3D surface geometry tolerance Geometric tolerance (default: 1e-7) Face shape

Parameters:

  • surface - 3D surface geometry tolerance Geometric tolerance (default: 1e-7) Face shape
  • tolerance - Geometric tolerance (default: 1e-7) Face shape
CreateFace

Create face shape from surface with UV parameter bounds.

cpp
static LShape CreateFace(const  & LSurface surface, double uMin, double uMax, double vMin, double vMax, double tolerance);

surface 3D surface geometry uMin Minimum U parameter uMax Maximum U parameter vMin Minimum V parameter vMax Maximum V parameter tolerance Geometric tolerance (default: 1e-7) Face shape

Parameters:

  • surface - 3D surface geometry uMin Minimum U parameter uMax Maximum U parameter vMin Minimum V parameter vMax Maximum V parameter tolerance Geometric tolerance (default: 1e-7) Face shape
  • uMin - Minimum U parameter uMax Maximum U parameter vMin Minimum V parameter vMax Maximum V parameter tolerance Geometric tolerance (default: 1e-7) Face shape
  • uMax - Maximum U parameter vMin Minimum V parameter vMax Maximum V parameter tolerance Geometric tolerance (default: 1e-7) Face shape
  • vMin - Minimum V parameter vMax Maximum V parameter tolerance Geometric tolerance (default: 1e-7) Face shape
  • vMax - Maximum V parameter tolerance Geometric tolerance (default: 1e-7) Face shape
  • tolerance - Geometric tolerance (default: 1e-7) Face shape
CreateFaceFromWire

Create face from outer boundary wire.

cpp
static LShape CreateFaceFromWire(const  & LShape outerWire, double tolerance);

outerWire Outer boundary wire defining face perimeter tolerance Geometric tolerance (default: 1e-7) Face shape with wire boundary

Parameters:

  • outerWire - Outer boundary wire defining face perimeter tolerance Geometric tolerance (default: 1e-7) Face shape with wire boundary
  • tolerance - Geometric tolerance (default: 1e-7) Face shape with wire boundary
CreateFaceFromWires

Create face from outer boundary wire with holes.

cpp
static LShape CreateFaceFromWires(const  & LShape outerWire, const std::vector<  > & LShape holeWires, double tolerance);

outerWire Outer boundary wire defining face perimeter holeWires of inner wires defining holes Vector tolerance Geometric tolerance (default: 1e-7) Face shape with boundary and holes

Parameters:

  • outerWire - Outer boundary wire defining face perimeter holeWires of inner wires defining holes Vector tolerance Geometric tolerance (default: 1e-7) Face shape with boundary and holes
  • holeWires - of inner wires defining holes Vector tolerance Geometric tolerance (default: 1e-7) Face shape with boundary and holes
  • tolerance - Geometric tolerance (default: 1e-7) Face shape with boundary and holes
CreateTriangularFace

Create triangular face from three points.

cpp
static LShape CreateTriangularFace(const  & Point p1, const  & Point p2, const  & Point p3, double tolerance);

p1 First vertex point p2 Second vertex point p3 Third vertex point tolerance Geometric tolerance (default: 1e-7) Triangular face shape

Parameters:

  • p1 - First vertex point p2 Second vertex point p3 Third vertex point tolerance Geometric tolerance (default: 1e-7) Triangular face shape
  • p2 - Second vertex point p3 Third vertex point tolerance Geometric tolerance (default: 1e-7) Triangular face shape
  • p3 - Third vertex point tolerance Geometric tolerance (default: 1e-7) Triangular face shape
  • tolerance - Geometric tolerance (default: 1e-7) Triangular face shape
CreateRectangularFace

Create rectangular face from four points.

cpp
static LShape CreateRectangularFace(const  & Point p1, const  & Point p2, const  & Point p3, const  & Point p4, double tolerance);

p1 First corner point p2 Second corner point p3 Third corner point p4 Fourth corner point tolerance Geometric tolerance (default: 1e-7) Rectangular face shape

Parameters:

  • p1 - First corner point p2 Second corner point p3 Third corner point p4 Fourth corner point tolerance Geometric tolerance (default: 1e-7) Rectangular face shape
  • p2 - Second corner point p3 Third corner point p4 Fourth corner point tolerance Geometric tolerance (default: 1e-7) Rectangular face shape
  • p3 - Third corner point p4 Fourth corner point tolerance Geometric tolerance (default: 1e-7) Rectangular face shape
  • p4 - Fourth corner point tolerance Geometric tolerance (default: 1e-7) Rectangular face shape
  • tolerance - Geometric tolerance (default: 1e-7) Rectangular face shape
CreatePolygonalFace

Create polygonal face from array of points.

cpp
static LShape CreatePolygonalFace(const std::vector<  > & Point points, double tolerance);

points of points defining polygon vertices Vector tolerance Geometric tolerance (default: 1e-7) Polygonal face shape

Parameters:

  • points - of points defining polygon vertices Vector tolerance Geometric tolerance (default: 1e-7) Polygonal face shape
  • tolerance - Geometric tolerance (default: 1e-7) Polygonal face shape
CreateFaceFromTriangulation

Create face from triangulation mesh.

cpp
static LShape CreateFaceFromTriangulation(const class  & LTriangulation triangulation, double tolerance);

triangulation Mesh triangulation data tolerance Geometric tolerance (default: 1e-7) Face shape from triangulation

Parameters:

  • triangulation - Mesh triangulation data tolerance Geometric tolerance (default: 1e-7) Face shape from triangulation
  • tolerance - Geometric tolerance (default: 1e-7) Face shape from triangulation
CreateEdgeFromPoints

Create straight edge between two points.

cpp
static LShape CreateEdgeFromPoints(const  & Point startPoint, const  & Point endPoint, double tolerance);

startPoint Start point of edge endPoint End point of edge tolerance Geometric tolerance (default: 1e-7) Linear edge shape

Parameters:

  • startPoint - Start point of edge endPoint End point of edge tolerance Geometric tolerance (default: 1e-7) Linear edge shape
  • endPoint - End point of edge tolerance Geometric tolerance (default: 1e-7) Linear edge shape
  • tolerance - Geometric tolerance (default: 1e-7) Linear edge shape
CreateEdgeFromVertices

Create edge between two existing vertices.

cpp
static LShape CreateEdgeFromVertices(const  & LShape startVertex, const  & LShape endVertex, double tolerance);

startVertex Start vertex shape endVertex End vertex shape tolerance Geometric tolerance (default: 1e-7) Linear edge shape connecting vertices

Parameters:

  • startVertex - Start vertex shape endVertex End vertex shape tolerance Geometric tolerance (default: 1e-7) Linear edge shape connecting vertices
  • endVertex - End vertex shape tolerance Geometric tolerance (default: 1e-7) Linear edge shape connecting vertices
  • tolerance - Geometric tolerance (default: 1e-7) Linear edge shape connecting vertices
CreatePolylineEdge

Create polyline edge from array of points.

cpp
static LShape CreatePolylineEdge(const std::vector<  > & Point points, double tolerance);

points of points defining polyline path Vector tolerance Geometric tolerance (default: 1e-7) Polyline edge shape

Parameters:

  • points - of points defining polyline path Vector tolerance Geometric tolerance (default: 1e-7) Polyline edge shape
  • tolerance - Geometric tolerance (default: 1e-7) Polyline edge shape
CreateArcEdge

Create circular arc edge.

cpp
static LShape CreateArcEdge(const  & Point center, const  & Vector normal, double radius, double startAngle, double endAngle, double tolerance);

center Center point of arc normal Normal vector to arc plane radius Arc radius startAngle Start angle in radians endAngle End angle in radians tolerance Geometric tolerance (default: 1e-7) Circular arc edge shape

Parameters:

  • center - Center point of arc normal Normal vector to arc plane radius Arc radius startAngle Start angle in radians endAngle End angle in radians tolerance Geometric tolerance (default: 1e-7) Circular arc edge shape
  • normal - Normal vector to arc plane radius Arc radius startAngle Start angle in radians endAngle End angle in radians tolerance Geometric tolerance (default: 1e-7) Circular arc edge shape
  • radius - Arc radius startAngle Start angle in radians endAngle End angle in radians tolerance Geometric tolerance (default: 1e-7) Circular arc edge shape
  • startAngle - Start angle in radians endAngle End angle in radians tolerance Geometric tolerance (default: 1e-7) Circular arc edge shape
  • endAngle - End angle in radians tolerance Geometric tolerance (default: 1e-7) Circular arc edge shape
  • tolerance - Geometric tolerance (default: 1e-7) Circular arc edge shape
CreateArcEdgeThrough3Points

Create circular arc edge through three points.

cpp
static LShape CreateArcEdgeThrough3Points(const  & Point startPoint, const  & Point middlePoint, const  & Point endPoint, double tolerance);

startPoint Start point of arc middlePoint Middle point on arc endPoint End point of arc tolerance Geometric tolerance (default: 1e-7) Circular arc edge shape

Parameters:

  • startPoint - Start point of arc middlePoint Middle point on arc endPoint End point of arc tolerance Geometric tolerance (default: 1e-7) Circular arc edge shape
  • middlePoint - Middle point on arc endPoint End point of arc tolerance Geometric tolerance (default: 1e-7) Circular arc edge shape
  • endPoint - End point of arc tolerance Geometric tolerance (default: 1e-7) Circular arc edge shape
  • tolerance - Geometric tolerance (default: 1e-7) Circular arc edge shape
CreateWireFromEdges

Create wire from ordered collection of edges.

cpp
static LShape CreateWireFromEdges(const std::vector<  > & LShape edges, double tolerance);

edges of connected edges Vector tolerance Geometric tolerance (default: 1e-7) Wire shape

Parameters:

  • edges - of connected edges Vector tolerance Geometric tolerance (default: 1e-7) Wire shape
  • tolerance - Geometric tolerance (default: 1e-7) Wire shape
CreateRectangularWire

Create rectangular wire from corner points.

cpp
static LShape CreateRectangularWire(const  & Point p1, const  & Point p2, const  & Point p3, const  & Point p4, double tolerance);

p1 First corner point p2 Second corner point p3 Third corner point p4 Fourth corner point tolerance Geometric tolerance (default: 1e-7) Rectangular wire shape

Parameters:

  • p1 - First corner point p2 Second corner point p3 Third corner point p4 Fourth corner point tolerance Geometric tolerance (default: 1e-7) Rectangular wire shape
  • p2 - Second corner point p3 Third corner point p4 Fourth corner point tolerance Geometric tolerance (default: 1e-7) Rectangular wire shape
  • p3 - Third corner point p4 Fourth corner point tolerance Geometric tolerance (default: 1e-7) Rectangular wire shape
  • p4 - Fourth corner point tolerance Geometric tolerance (default: 1e-7) Rectangular wire shape
  • tolerance - Geometric tolerance (default: 1e-7) Rectangular wire shape
CreatePolygonalWire

Create polygonal wire from array of points.

cpp
static LShape CreatePolygonalWire(const std::vector<  > & Point points, bool closed, double tolerance);

points of points defining polygon vertices Vector closed Whether to close the polygon (default: true) tolerance Geometric tolerance (default: 1e-7) Polygonal wire shape

Parameters:

  • points - of points defining polygon vertices Vector closed Whether to close the polygon (default: true) tolerance Geometric tolerance (default: 1e-7) Polygonal wire shape
  • closed - Whether to close the polygon (default: true) tolerance Geometric tolerance (default: 1e-7) Polygonal wire shape
  • tolerance - Geometric tolerance (default: 1e-7) Polygonal wire shape
CreateShell

Create shell shape from collection of faces.

cpp
static LShape CreateShell();

Empty shell shape (faces can be added using builder methods)

CreateSolid

Create solid shape from shell.

cpp
static LShape CreateSolid();

Empty solid shape (shells can be added using builder methods)

CreateCompound

Create compound shape from collection of shapes.

cpp
static LShape CreateCompound();

Empty compound shape (shapes can be added using builder methods)

Instance Methods

GetType

Get the current shape type.

cpp
ShapeTypeEnum GetType() const;

Shape type enumeration value

IsValid

Check if shape is valid (not null or undefined).

cpp
bool IsValid() const;

True if shape is valid

IsCompound
cpp
bool IsCompound() const;
IsCompSolid
cpp
bool IsCompSolid() const;
IsSolid
cpp
bool IsSolid() const;
IsShell
cpp
bool IsShell() const;
IsFace
cpp
bool IsFace() const;
IsWire
cpp
bool IsWire() const;
IsEdge
cpp
bool IsEdge() const;
IsVertex
cpp
bool IsVertex() const;
LShape

Default constructor creates undefined shape.

cpp
 LShape() const;
~LShape

Destructor.

cpp
 ~LShape() const;
LShape

Copy constructor.

cpp
 LShape(const  & LShape other) const;
operator=

Assignment operator.

cpp
& LShape operator=(const  & LShape other) const;
GetShapeData

Get complete shape data for cross-language exchange.

cpp
ShapeData GetShapeData() const;

POD structure with all shape metadata ShapeData

GetVertexData

Get vertex-specific data (valid only for VERTEX shapes).

cpp
VertexData GetVertexData() const;

POD structure with point position and tolerance VertexData

GetEdgeData

Get edge-specific data (valid only for EDGE shapes).

cpp
EdgeData GetEdgeData() const;

POD structure with parameter bounds and properties EdgeData

GetFaceData

Get face-specific data (valid only for FACE shapes).

cpp
FaceData GetFaceData() const;

POD structure with UV parameter bounds FaceData

GetCurve

Extract curve geometry from edge shape.

cpp
LCurve GetCurve() const;

geometry (valid only for EDGE shapes) LCurve

GetCurve

Extract curve geometry from edge shape with parameter bounds.

cpp
LCurve GetCurve(double & firstParam, double & lastParam) const;

firstParam Output parameter for curve start lastParam Output parameter for curve end geometry (valid only for EDGE shapes) LCurve

Parameters:

  • firstParam - Output parameter for curve start lastParam Output parameter for curve end geometry (valid only for EDGE shapes) LCurve
  • lastParam - Output parameter for curve end geometry (valid only for EDGE shapes) LCurve
GetSurface

Extract surface geometry from face shape.

cpp
LSurface GetSurface() const;

geometry (valid only for FACE shapes) LSurface

GetSurface

Extract surface geometry from face shape with parameter bounds.

cpp
LSurface GetSurface(double & uMin, double & uMax, double & vMin, double & vMax) const;

uMin Output parameter for minimum U bound uMax Output parameter for maximum U bound vMin Output parameter for minimum V bound vMax Output parameter for maximum V bound geometry (valid only for FACE shapes) LSurface

Parameters:

  • uMin - Output parameter for minimum U bound uMax Output parameter for maximum U bound vMin Output parameter for minimum V bound vMax Output parameter for maximum V bound geometry (valid only for FACE shapes) LSurface
  • uMax - Output parameter for maximum U bound vMin Output parameter for minimum V bound vMax Output parameter for maximum V bound geometry (valid only for FACE shapes) LSurface
  • vMin - Output parameter for minimum V bound vMax Output parameter for maximum V bound geometry (valid only for FACE shapes) LSurface
  • vMax - Output parameter for maximum V bound geometry (valid only for FACE shapes) LSurface
GetNbChildren

Get number of direct sub-shapes (children).

cpp
int GetNbChildren() const;

Number of child shapes

IsNull

Check if shape is null (no underlying geometry).

cpp
bool IsNull() const;

True if shape is null

IsEqual

Check if shape is equal to another shape.

cpp
bool IsEqual(const  & LShape other) const;

other Other shape to compare True if shapes are equal

Parameters:

  • other - Other shape to compare True if shapes are equal
IsSame

Check if shape is same as another (shares same underlying data).

cpp
bool IsSame(const  & LShape other) const;

other Other shape to compare True if shapes are same

Parameters:

  • other - Other shape to compare True if shapes are same
IsPartner

Check if shape is partner of another (same TShape, different location/orientation).

cpp
bool IsPartner(const  & LShape other) const;

other Other shape to compare True if shapes are partners

Parameters:

  • other - Other shape to compare True if shapes are partners
Transform

Transform shape in place.

cpp
void Transform(const class  & LTransform transform) const;

transform 3D transformation to apply

Parameters:

  • transform - 3D transformation to apply
Transformed

Get transformed copy of shape.

cpp
LShape Transformed(const class  & LTransform transform) const;

transform 3D transformation to apply New transformed shape

Parameters:

  • transform - 3D transformation to apply New transformed shape
Move

Move shape by location transformation.

cpp
void Move(const  & TransformationData location) const;

location Location transformation to apply

Parameters:

  • location - Location transformation to apply
Moved

Get moved copy of shape.

cpp
LShape Moved(const  & TransformationData location) const;

location Location transformation to apply New moved shape

Parameters:

  • location - Location transformation to apply New moved shape
GetOrientation

Get shape orientation.

cpp
ShapeOrientation GetOrientation() const;

Shape orientation enumeration

SetOrientation

Set shape orientation.

cpp
void SetOrientation(ShapeOrientation orientation) const;

orientation New orientation

Parameters:

  • orientation - New orientation
Oriented

Get oriented copy of shape.

cpp
LShape Oriented(ShapeOrientation orientation) const;

orientation Desired orientation New oriented shape

Parameters:

  • orientation - Desired orientation New oriented shape
Reverse

Reverse shape orientation.

cpp
void Reverse() const;
Reversed

Get reversed copy of shape.

cpp
LShape Reversed() const;

New reversed shape

Complement

Complement shape orientation.

cpp
void Complement() const;
Complemented

Get complemented copy of shape.

cpp
LShape Complemented() const;

New complemented shape

GetFlags

Get all shape state flags.

cpp
ShapeFlags GetFlags() const;

POD structure ShapeFlags

SetFlags

Set shape state flags.

cpp
void SetFlags(const  & ShapeFlags flags) const;

flags New flags to set

Parameters:

  • flags - New flags to set
IsFree
cpp
bool IsFree() const;
SetFree
cpp
void SetFree(bool free) const;
IsLocked
cpp
bool IsLocked() const;
SetLocked
cpp
void SetLocked(bool locked) const;
IsModified
cpp
bool IsModified() const;
SetModified
cpp
void SetModified(bool modified) const;
Nullify

Make shape null (remove all geometry).

cpp
void Nullify() const;
HashCode

Get hash code for shape.

cpp
size_t HashCode() const;

Hash code integer

AddSubShape

Add a sub-shape to this compound/collection shape. This method only works for compound shapes and uses OCCT builders internally.

cpp
bool AddSubShape(const  & LShape subShape, ShapeOrientation orientation) const;

subShape Shape to add as a child orientation Orientation for the added shape (default: FORWARD) True if sub-shape was successfully added, false otherwise

Parameters:

  • subShape - Shape to add as a child orientation Orientation for the added shape (default: FORWARD) True if sub-shape was successfully added, false otherwise
  • orientation - Orientation for the added shape (default: FORWARD) True if sub-shape was successfully added, false otherwise
RemoveSubShape

Remove a sub-shape from this compound/collection shape. This method only works for compound shapes and uses OCCT builders internally.

cpp
bool RemoveSubShape(const  & LShape subShape) const;

subShape Shape to remove from children True if sub-shape was successfully removed, false otherwise

Parameters:

  • subShape - Shape to remove from children True if sub-shape was successfully removed, false otherwise
CanAddSubShape

Check if a specific sub-shape can be added to this shape. Validates type hierarchy rules (e.g., compounds can contain any shapes, solids can contain shells, etc.)

cpp
bool CanAddSubShape(const  & LShape subShape) const;

subShape Shape to test for addition compatibility True if the sub-shape can be added to this shape

Parameters:

  • subShape - Shape to test for addition compatibility True if the sub-shape can be added to this shape
ContainsSubShape

Check if a specific sub-shape exists as a direct child. Uses shape comparison to find matching sub-shapes.

cpp
bool ContainsSubShape(const  & LShape subShape) const;

subShape Shape to search for in children True if the sub-shape is found as a direct child

Parameters:

  • subShape - Shape to search for in children True if the sub-shape is found as a direct child
ClearSubShapes

Clear all sub-shapes from this compound/collection shape. This method only works for compound shapes and creates a new empty compound.

cpp
bool ClearSubShapes() const;

True if sub-shapes were successfully cleared, false otherwise

GetSubShapes

Get all direct sub-shapes as a vector. Uses internal iteration to collect all immediate children.

cpp
std::vector<  > LShape GetSubShapes() const;

of all direct child shapes Vector

GetSubShapeCount

Get count of direct sub-shapes. More efficient than .size() for count-only operations. GetSubShapes()

cpp
int GetSubShapeCount() const;

Number of direct child shapes

GetTriangulation

Extract triangulation data from meshed faces in the shape. This method extracts all triangulation data from faces that have been meshed using mesh generation methods (like QuickMesh from ). LMesher

cpp
std::vector< class  > LTriangulation GetTriangulation() const;

of triangulations from all meshed faces, empty vector if none found Vector

GetPolygon3d

Extract polygon data from meshed edges in the shape. This method extracts all polygon data from edges that have been meshed using mesh generation methods.

cpp
std::vector< class  > LPolygon3d GetPolygon3d() const;

of polygons from all meshed edges, empty vector if none found Vector

Enumerations

ShapeTypeEnum

Shape type enumeration following OCCT TopAbs_ShapeEnum. Defines all possible topological shape types.

cpp
enum ShapeTypeEnum {
    SHAPE_COMPOUND, // A group of any of the shapes below.
    SHAPE_COMPSOLID, // A set of solids connected by their faces.
    SHAPE_SOLID, // A part of 3D space bounded by shells.
    SHAPE_SHELL, // A set of faces connected by edges.
    SHAPE_FACE, // Part of a surface bounded by a closed wire.
    SHAPE_WIRE, // A sequence of edges connected by vertices.
    SHAPE_EDGE, // A curve bound by vertices at extremities.
    SHAPE_VERTEX, // A zero-dimensional shape (point)
    SHAPE_UNDEFINED, // Invalid/undefined shape type.
};

Type Definitions

TypeEnum

Generic type alias for templates.

cpp
ShapeTypeEnum TypeEnum;

LightOcct::LShapeExplorer

Light OCCT wrapper for TopExp_Explorer with enum + Handle pattern.

Provides hierarchical exploration of shapes to find sub-shapes of specific types. Follows Light OCCT architectural patterns: Enum + Handle pattern for type-safe storage POD structures for cross-language data exchange Wrapper methods using only Light OCCT types No OCCT types exposed in public interface Exploration Logic (following OCCT TopExp_Explorer): Explores sub-shapes in hierarchical order: COMPOUND -> COMPSOLID -> SOLID -> SHELL -> FACE -> WIRE -> EDGE -> VERTEX Can explore all sub-shapes of a given type within a shape Can avoid sub-shapes of a specific type during exploration Maintains iteration state for sequential access Usage Example: LShapecompound=CreateSomeCompoundShape(); //Findallfacesinthecompound explorer(compound,); LShapeExplorer LShape::SHAPE_FACE while (explorer.More()){ LShapeface=explorer.Current(); //Processtheface explorer.Next(); } //Findalledgesnotcontainedinwires edgeExplorer(compound,,); LShapeExplorer LShape::SHAPE_EDGE LShape::SHAPE_WIRE for (edgeExplorer.Init();edgeExplorer.More();edgeExplorer.Next())

cpp
#include <light-occt/topology/LShapeExplorer.hxx>

Quick Reference

Fields: myState, myRootShape, myToFind, myToAvoid

Methods: GetState(), IsInitialized(), More(), LShapeExplorer(), LShapeExplorer(), LShapeExplorer(), ~LShapeExplorer(), LShapeExplorer(), operator=(), Init(), Init(), ReInit(), Current(), Next(), Count(), IsFirst(), GetRootShape(), GetToFind(), GetToAvoid(), HasAvoidance(), GetExplorerData(), GetAllShapes(), Reset(), IsDone(), CurrentAndNext()

Enums: ExplorerState


Fields

myState

cpp
ExplorerState myState;

myRootShape

cpp
LShape myRootShape;

myToFind

cpp
LShape::ShapeTypeEnum myToFind;

myToAvoid

cpp
LShape::ShapeTypeEnum myToAvoid;

Methods

Instance Methods

GetState

Get the current explorer state.

cpp
ExplorerState GetState() const;

Explorer state enumeration value

IsInitialized

Check if explorer is initialized and ready.

cpp
bool IsInitialized() const;

True if explorer is ready for iteration

More

Check if more shapes are available for iteration.

cpp
bool More() const;

True if more shapes can be accessed

LShapeExplorer

Default constructor creates uninitialized explorer.

cpp
 LShapeExplorer() const;
LShapeExplorer

Constructor with shape and type to find.

cpp
 LShapeExplorer(const  & LShape shape, LShape::ShapeTypeEnum toFind) const;

shape Root shape to explore toFind Type of sub-shapes to find

Parameters:

  • shape - Root shape to explore toFind Type of sub-shapes to find
  • toFind - Type of sub-shapes to find
LShapeExplorer

Constructor with shape, type to find, and type to avoid.

cpp
 LShapeExplorer(const  & LShape shape, LShape::ShapeTypeEnum toFind, LShape::ShapeTypeEnum toAvoid) const;

shape Root shape to explore toFind Type of sub-shapes to find toAvoid Type of sub-shapes to avoid during exploration

Parameters:

  • shape - Root shape to explore toFind Type of sub-shapes to find toAvoid Type of sub-shapes to avoid during exploration
  • toFind - Type of sub-shapes to find toAvoid Type of sub-shapes to avoid during exploration
  • toAvoid - Type of sub-shapes to avoid during exploration
~LShapeExplorer

Destructor.

cpp
 ~LShapeExplorer() const;
LShapeExplorer

Copy constructor.

cpp
 LShapeExplorer(const  & LShapeExplorer other) const;
operator=

Assignment operator.

cpp
& LShapeExplorer operator=(const  & LShapeExplorer other) const;
Init

Initialize explorer with shape and type to find.

cpp
void Init(const  & LShape shape, LShape::ShapeTypeEnum toFind) const;

shape Root shape to explore toFind Type of sub-shapes to find

Parameters:

  • shape - Root shape to explore toFind Type of sub-shapes to find
  • toFind - Type of sub-shapes to find
Init

Initialize explorer with shape, type to find, and type to avoid.

cpp
void Init(const  & LShape shape, LShape::ShapeTypeEnum toFind, LShape::ShapeTypeEnum toAvoid) const;

shape Root shape to explore toFind Type of sub-shapes to find toAvoid Type of sub-shapes to avoid during exploration

Parameters:

  • shape - Root shape to explore toFind Type of sub-shapes to find toAvoid Type of sub-shapes to avoid during exploration
  • toFind - Type of sub-shapes to find toAvoid Type of sub-shapes to avoid during exploration
  • toAvoid - Type of sub-shapes to avoid during exploration
ReInit

Reinitialize explorer with current settings. Resets iteration to the beginning.

cpp
void ReInit() const;
Current

Get the current shape in iteration.

cpp
LShape Current() const;

Current shape (valid only when returns true) More()

Next

Advance to the next shape in iteration.

cpp
void Next() const;
Count

Get total count of shapes that will be found. Note: This method iterates through all shapes to count them, then resets the explorer.

cpp
int Count() const;

Total number of shapes of the specified type

IsFirst

Check if current shape is the first in iteration.

cpp
bool IsFirst() const;

True if this is the first shape

GetRootShape

Get the root shape being explored.

cpp
LShape GetRootShape() const;

Root shape

GetToFind

Get the type of shapes being found.

cpp
LShape::ShapeTypeEnum GetToFind() const;

Shape type enumeration

GetToAvoid

Get the type of shapes being avoided.

cpp
LShape::ShapeTypeEnum GetToAvoid() const;

Shape type enumeration (SHAPE_UNDEFINED if no avoidance)

HasAvoidance

Check if explorer is configured to avoid a specific type.

cpp
bool HasAvoidance() const;

True if avoidance is configured

GetExplorerData

Get explorer configuration data for cross-language exchange.

cpp
ExplorerData GetExplorerData() const;

POD structure ExplorerData

GetAllShapes

Get complete iteration results as vector of shapes. Note: This method performs complete iteration and returns all found shapes.

cpp
std::vector<  > LShape GetAllShapes() const;

of all shapes found by the explorer Vector

Reset

Reset explorer to the beginning of iteration.

cpp
void Reset() const;
IsDone

Check if explorer has reached the end.

cpp
bool IsDone() const;

True if no more shapes are available

CurrentAndNext

Get current shape and advance to next (convenience method).

cpp
LShape CurrentAndNext() const;

Current shape, then advances iterator

Enumerations

ExplorerState

Explorer state enumeration for iteration status.

cpp
enum ExplorerState {
    EXPLORER_INITIALIZED, // Explorer is initialized and ready.
    EXPLORER_MORE, // More shapes available for iteration.
    EXPLORER_DONE, // No more shapes to explore.
    EXPLORER_UNDEFINED, // Explorer is not initialized.
};

LightOcct::LShapeIterator

Light OCCT wrapper for TopoDS_Iterator with enum + Handle pattern.

Provides direct iteration over immediate sub-shapes of a compound shape. Follows Light OCCT architectural patterns: Enum + Handle pattern for type-safe storage POD structures for cross-language data exchange Wrapper methods using only Light OCCT types No OCCT types exposed in public interface Iterator Logic (following OCCT TopoDS_Iterator): Iterates only over direct children of the given shape Does NOT recurse into sub-shapes (use for hierarchical exploration) LShapeExplorer Maintains original orientation and location of sub-shapes Provides access to both shape and its orientation Difference from : LShapeExplorer : Iterates direct children only (like TopoDS_Iterator) LShapeIterator : Hierarchically explores all sub-shapes of a type (like TopExp_Explorer) LShapeExplorer Usage Example: LShapecompound=CreateSomeCompoundShape(); //Iteratethroughdirectchildrenonly iterator(compound); LShapeIterator while (iterator.More()){ LShapechild=iterator.Current(); orientation=iterator.CurrentOrientation(); ShapeOrientation //Processthechildshape iterator.Next(); } //Alternativeiterationstyle for (it(compound);it.More();it.Next())

cpp
#include <light-occt/topology/LShapeIterator.hxx>

Quick Reference

Fields: myState, myRootShape, myCumulOrientation, myCumulLocation

Methods: GetState(), IsInitialized(), More(), LShapeIterator(), LShapeIterator(), LShapeIterator(), ~LShapeIterator(), LShapeIterator(), operator=(), Init(), Init(), ReInit(), Current(), CurrentOrientation(), CurrentShapeData(), Next(), Count(), IsFirst(), GetRootShape(), GetCumulativeOrientation(), GetCumulativeLocation(), GetIteratorData(), GetAllShapes(), GetAllShapeData(), Reset(), IsDone(), CurrentAndNext(), CurrentDataAndNext()

Enums: IteratorState


Fields

myState

cpp
IteratorState myState;

myRootShape

cpp
LShape myRootShape;

myCumulOrientation

cpp
bool myCumulOrientation;

myCumulLocation

cpp
bool myCumulLocation;

Methods

Instance Methods

GetState

Get the current iterator state.

cpp
IteratorState GetState() const;

Iterator state enumeration value

IsInitialized

Check if iterator is initialized and ready.

cpp
bool IsInitialized() const;

True if iterator is ready for iteration

More

Check if more shapes are available for iteration.

cpp
bool More() const;

True if more shapes can be accessed

LShapeIterator

Default constructor creates uninitialized iterator.

cpp
 LShapeIterator() const;
LShapeIterator

Constructor with shape to iterate.

cpp
 LShapeIterator(const  & LShape shape) const;

shape Root shape whose children to iterate

Parameters:

  • shape - Root shape whose children to iterate
LShapeIterator

Constructor with shape and orientation/location flags.

cpp
 LShapeIterator(const  & LShape shape, bool cumulOrientation, bool cumulLocation) const;

shape Root shape whose children to iterate cumulOrientation If true, compose orientations cumulLocation If true, compose locations

Parameters:

  • shape - Root shape whose children to iterate cumulOrientation If true, compose orientations cumulLocation If true, compose locations
  • cumulOrientation - If true, compose orientations cumulLocation If true, compose locations
  • cumulLocation - If true, compose locations
~LShapeIterator

Destructor.

cpp
 ~LShapeIterator() const;
LShapeIterator

Copy constructor.

cpp
 LShapeIterator(const  & LShapeIterator other) const;
operator=

Assignment operator.

cpp
& LShapeIterator operator=(const  & LShapeIterator other) const;
Init

Initialize iterator with shape.

cpp
void Init(const  & LShape shape) const;

shape Root shape whose children to iterate

Parameters:

  • shape - Root shape whose children to iterate
Init

Initialize iterator with shape and composition flags.

cpp
void Init(const  & LShape shape, bool cumulOrientation, bool cumulLocation) const;

shape Root shape whose children to iterate cumulOrientation If true, compose orientations cumulLocation If true, compose locations

Parameters:

  • shape - Root shape whose children to iterate cumulOrientation If true, compose orientations cumulLocation If true, compose locations
  • cumulOrientation - If true, compose orientations cumulLocation If true, compose locations
  • cumulLocation - If true, compose locations
ReInit

Reinitialize iterator with current settings. Resets iteration to the beginning.

cpp
void ReInit() const;
Current

Get the current shape in iteration.

cpp
LShape Current() const;

Current child shape (valid only when returns true) More()

CurrentOrientation

Get the orientation of current shape.

cpp
ShapeOrientation CurrentOrientation() const;

Current shape orientation relative to parent

CurrentShapeData

Get current shape data including orientation and location.

cpp
ShapeData CurrentShapeData() const;

Complete shape data POD structure

Next

Advance to the next shape in iteration.

cpp
void Next() const;
Count

Get total count of direct children. Note: This method iterates through all children to count them, then resets the iterator.

cpp
int Count() const;

Total number of direct child shapes

IsFirst

Check if current shape is the first in iteration.

cpp
bool IsFirst() const;

True if this is the first child shape

GetRootShape

Get the root shape being iterated.

cpp
LShape GetRootShape() const;

Root shape

GetCumulativeOrientation

Check if iterator is configured to cumulate orientations.

cpp
bool GetCumulativeOrientation() const;

True if orientations are being composed

GetCumulativeLocation

Check if iterator is configured to cumulate locations.

cpp
bool GetCumulativeLocation() const;

True if locations are being composed

GetIteratorData

Get iterator configuration data for cross-language exchange.

cpp
IteratorData GetIteratorData() const;

POD structure IteratorData

GetAllShapes

Get complete iteration results as vector of shapes. Note: This method performs complete iteration and returns all child shapes.

cpp
std::vector<  > LShape GetAllShapes() const;

of all direct child shapes Vector

GetAllShapeData

Get complete iteration results with orientations. Note: This method performs complete iteration and returns all child shapes with their orientations.

cpp
std::vector<  > ShapeData GetAllShapeData() const;

of all child shapes and their orientation data Vector

Reset

Reset iterator to the beginning of iteration.

cpp
void Reset() const;
IsDone

Check if iterator has reached the end.

cpp
bool IsDone() const;

True if no more shapes are available

CurrentAndNext

Get current shape and advance to next (convenience method).

cpp
LShape CurrentAndNext() const;

Current shape, then advances iterator

CurrentDataAndNext

Get current shape data and advance to next (convenience method).

cpp
ShapeData CurrentDataAndNext() const;

Current shape data, then advances iterator

Enumerations

IteratorState

Iterator state enumeration for iteration status.

cpp
enum IteratorState {
    ITERATOR_INITIALIZED, // Iterator is initialized and ready.
    ITERATOR_MORE, // More shapes available for iteration.
    ITERATOR_DONE, // No more shapes to iterate.
    ITERATOR_UNDEFINED, // Iterator is not initialized.
};

Released under the LGPL-2.1 License