API Reference > Other Classes > OdModelerGeometry Class > OdModelerGeometry Methods > getSlice Method > OdModelerGeometry::getSlice Method (OdDbSurface*, bool, OdDb3dSolidPtr&)
OdModelerGeometry::getSlice Method (OdDbSurface*, bool, OdDb3dSolidPtr&)
Syntax
C++
virtual OdResult getSlice(OdDbSurface* pSurface, bool bGetNegHalfToo, OdDb3dSolidPtr& pNegHalfSolid) = 0;
Parameters 
Description 
OdDbSurface* pSurface 
[in] Pointer to a slicing surface.  
bool bGetNegHalfToo 
[in] Flag determining whether the other (negative) part of the native ModelerGeometry object should be created as a separate ModelerGeometry object (when true).  
OdDb3dSolidPtr& pNegHalfSolid 
[out] Reference to a pointer to the created ModelerGeometry object representing the negative half of the native ModelerGeometry object. If bGetNegHalfToo is false, NULL value is returned.
 

Returns eOk if the native ModelerGeometry object was successfully sliced or an appropriate error code in other case. If pSurface pointer is NULL or the ModelerGeometry object is empty, returns eInvalidInput.

Slices the ModelerGeometry object with a surface and transforms the native ModelerGeometry object to be the portion remaining on the positive side of the slicing surface normal. 

 

The native ModelerGeometry object will be transformed to a resulting body which is located in the negative side of the surface normal. 

The caller of this function is responsible for the memory used by the object pointed to by pNegHalfSolid when the function finishes. If pNegHalfSolid is added to a database, the database takes responsibility for the memory. If pNegHalfSolid is not added to a database, the caller must delete memory when it is no longer needed to avoid a memory leak.

Copyright © 2002–2020. Open Design Alliance. All rights reserved.