For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

TShape modification (and general ownership and lifetime questions)

Andreas Fleischner's picture
Forums: 

We require a mutable type of "path" (both 3d and 2d) where i can split or add and modify segments. These operations should be very lightweight.

It seems that the BRep internal TShape types are immutable after creation and not the correct facility?

What is the best way to archive this, or should we build our own facilities on top of Geom_Curve?

In addition I have some questions that remain open after reading the docs:

In most cases this concerns lifetime questions as OCC mostly passes handles vs current modern c++ rules that move/pass unique_ptr/shared_ptr only for ownership/lifetime transfer and pass (const) references for local usage.

E.g for the BRep_Tool Class:

static const HandleGeom_Curve > &  Curve (const TopoDS_Edge &E, TopLoc_Location &L, Standard_Real &First, Standard_Real &Last)
static HandleGeom_Curve >  Curve (const TopoDS_Edge &E, Standard_Real &First, Standard_Real &Last)

- Why does the TopLoc_Location version returns an const Handle Reference. What is the lifetime of this object? Can I store it?

- Can I modify the Geom_Curve? It is not const.

- In General who is the owner of an Geom_Curve? When I pass a Geom_Curve to an Edge I also pass the ownership? After this operation any manual change to the curve might horribly break the BRep and I should always use the BRep_Falcilities instead?

-  Are multiple shapes allowed to share the same curve?