CCCoreLib Data Structures & Interfaces
Vectors
CCVector3
See also
C++: CCCoreLib::CCVector3
- class cccorelib.CCVector3
- __add__(self: cccorelib.CCVector3, arg0: cccorelib.CCVector3) cccorelib.CCVector3
- __div__(self: cccorelib.CCVector3, arg0: float) cccorelib.CCVector3
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: cccorelib.CCVector3) -> None
__init__(self: cccorelib.CCVector3, arg0: float, arg1: float, arg2: float) -> None
- __mul__(self: cccorelib.CCVector3, arg0: float) cccorelib.CCVector3
- __repr__(self: cccorelib.CCVector3) str
- __sub__(self: cccorelib.CCVector3, arg0: cccorelib.CCVector3) cccorelib.CCVector3
- __module__ = 'cccorelib'
PointClouds
GenericCloud
See also
C++: CCCoreLib::GenericCloud
- class cccorelib.GenericCloud
- enableScalarField(self: cccorelib.GenericCloud) bool
- forEach(self: cccorelib.GenericCloud, action: Callable[[cccorelib.CCVector3, float], None]) None
- getBoundingBox(self: cccorelib.GenericCloud, bbMin: cccorelib.CCVector3, bbMax: cccorelib.CCVector3) None
- getNextPoint(self: cccorelib.GenericCloud) cccorelib.CCVector3
- getPointScalarValue(self: cccorelib.GenericCloud, pointIndex: int) float
- isScalarFieldEnabled(self: cccorelib.GenericCloud) bool
- placeIteratorAtBeginning(self: cccorelib.GenericCloud) None
- setPointScalarValue(self: cccorelib.GenericCloud, pointIndex: int, value: float) None
- size(self: cccorelib.GenericCloud) int
- testVisibility(self: cccorelib.GenericCloud, P: cccorelib.CCVector3) int
GenericIndexedCloud
See also
C++: CCCoreLib::GenericIndexedCloud
- class cccorelib.GenericIndexedCloud
Bases:
GenericCloud
- getPoint(*args, **kwargs)
Overloaded function.
getPoint(self: cccorelib.GenericIndexedCloud, arg0: int) -> cccorelib.CCVector3
getPoint(self: cccorelib.GenericIndexedCloud, arg0: int, arg1: cccorelib.CCVector3) -> None
GenericIndexedCloudPersist
See also
C++: CCCoreLib::GenericIndexedCloudPersist
- class cccorelib.GenericIndexedCloudPersist
Bases:
GenericIndexedCloud
- getPointPersistentPtr(self: cccorelib.GenericIndexedCloudPersist, index: int) cccorelib.CCVector3
PointCloud
See also
C++: CCCoreLib::PointCloud
- class cccorelib.PointCloud
Bases:
__pointCloudTplCCCoreLib
- addNormal(self: cccorelib.PointCloud, normal: cccorelib.CCVector3) None
- reserveNormals(self: cccorelib.PointCloud, newCount: int) bool
ReferenceCloud
See also
C++: CCCoreLib::ReferenceCloud
- class cccorelib.ReferenceCloud
Bases:
GenericIndexedCloudPersist
- add(self: cccorelib.ReferenceCloud, cloud: cccorelib.ReferenceCloud) bool
- addPointIndex(*args, **kwargs)
Overloaded function.
addPointIndex(self: cccorelib.ReferenceCloud, unsigned: int) -> bool
addPointIndex(self: cccorelib.ReferenceCloud, firstIndex: int, lastIndex: int) -> bool
- capacity(self: cccorelib.ReferenceCloud) int
- clear(self: cccorelib.ReferenceCloud, releaseMemory: bool = False) None
- forwardIterator(self: cccorelib.ReferenceCloud) None
- getAssociatedCloud(self: cccorelib.ReferenceCloud) cccorelib.GenericIndexedCloudPersist
- getCurrentPointCoordinates(self: cccorelib.ReferenceCloud) cccorelib.CCVector3
- getCurrentPointGlobalIndex(self: cccorelib.ReferenceCloud) int
- getCurrentPointScalarValue(self: cccorelib.ReferenceCloud) float
- getPointGlobalIndex(self: cccorelib.ReferenceCloud, arg0: int) int
- invalidateBoundingBox(self: cccorelib.ReferenceCloud) None
- removeCurrentPointGlobalIndex(self: cccorelib.ReferenceCloud) None
- removePointGlobalIndex(self: cccorelib.ReferenceCloud, localIndex: int) None
- reserve(self: cccorelib.ReferenceCloud, n: int) bool
- resize(self: cccorelib.ReferenceCloud, arg0: int) bool
_n
- setAssociatedCloud(self: cccorelib.ReferenceCloud, cloud: cccorelib.GenericIndexedCloudPersist) None
- setCurrentPointScalarValue(self: cccorelib.ReferenceCloud, arg0: float) None
- setPointIndex(self: cccorelib.ReferenceCloud, firstIndex: int, lastIndex: int) None
- swap(self: cccorelib.ReferenceCloud, i: int, j: int) None
Meshes
GenericTriangle
See also
C++: CCCoreLib::GenericTriangle
- class cccorelib.GenericTriangle
GenericMesh
See also
C++: CCCoreLib::GenericMesh
- class cccorelib.GenericMesh
A generic mesh interface for data communication between library and client applications
- forEach(self: cccorelib.GenericMesh, action: std::function<void (CCCoreLib::GenericTriangle&)>) None
- getBoundingBox(self: cccorelib.GenericMesh, bbMin: cccorelib.CCVector3, bbMax: cccorelib.CCVector3) None
Returns the mesh bounding-box
- Parameters:
bbMin (out parameter, lower bounding-box limits (Xmin,Ymin,Zmin)) –
bbMax (out parameter, higher bounding-box limits (Xmax,Ymax,Zmax)) –
- placeIteratorAtBeginning(self: cccorelib.GenericMesh) None
- size(self: cccorelib.GenericMesh) int
Returns the number of triangles
GenericIndexedMesh
See also
C++: CCCoreLib::GenericIndexedMesh
- class cccorelib.GenericIndexedMesh
Bases:
GenericMesh
- getNextTriangleVertIndexes(self: cccorelib.GenericIndexedMesh) cccorelib.VerticesIndexes
- getTriangleVertIndexes(self: cccorelib.GenericIndexedMesh, triangleIndex: int) cccorelib.VerticesIndexes
Returns the indexes of the vertices of a given triangle
- Parameters:
triangleIndex (int, index of the triangle) –
- Raises:
IndexError if triangleIndex >= self.size() –
- getTriangleVertices(self: cccorelib.GenericIndexedMesh, triangleIndex: int, A: cccorelib.CCVector3, B: cccorelib.CCVector3, C: cccorelib.CCVector3) None
Returns the vertices of a given triangle
- Parameters:
triangleIndex (index of the triangle) –
A (first vertex, this is an out parameter) –
B (second vertex, this is an out parameter) –
C (third vertex, this is an out parameter) –
- Raises:
IndexError if triangleIndex >= self.size() –
Delaunay2dMesh
See also
C++: CCCoreLib::Delaunay2dMesh
- class cccorelib.Delaunay2dMesh
Bases:
GenericIndexedMesh
- static Available() bool
- static TesselateContour(*args, **kwargs)
Overloaded function.
TesselateContour(contourPoints: cccorelib.CCVector2List) -> cccorelib.Delaunay2dMesh
TesselateContour(contourPoints: cccorelib.GenericIndexedCloudPersist, flatDimension: int = -1) -> cccorelib.Delaunay2dMesh
- buildMesh(*args, **kwargs)
Overloaded function.
buildMesh(self: cccorelib.Delaunay2dMesh, points2D: cccorelib.CCVector2List, pointCountToUse: int, outputErrorStr: str) -> bool
buildMesh(self: cccorelib.Delaunay2dMesh, points2D: cccorelib.CCVector2List, segments2D: std::vector<int, std::allocator<int> >, outputErrorStr: str) -> bool
- getAssociatedCloud(self: cccorelib.Delaunay2dMesh) cccorelib.GenericIndexedCloud
- getTriangleVertIndexesArray(*args, **kwargs)
Overloaded function.
getTriangleVertIndexesArray(self: cccorelib.Delaunay2dMesh) -> int
getTriangleVertIndexesArray(self: cccorelib.Delaunay2dMesh, maxEdgeLength: float) -> bool
- linkMeshWith(self: cccorelib.Delaunay2dMesh, aCloud: cccorelib.GenericIndexedCloud, passOwnership: bool = False) None
- removeOuterTriangles(self: cccorelib.Delaunay2dMesh, vertices2D: cccorelib.CCVector2List, polygon2D: cccorelib.CCVector2List, removeOutside: bool = True) bool
- USE_ALL_POINTS = 0
Polyline
See also
C++: CCCoreLib::Polyline
- class cccorelib.Polyline
Bases:
ReferenceCloud
- clear(self: cccorelib.Polyline, unusedParam: bool = True) None
- isClosed(self: cccorelib.Polyline) bool
- setClosed(self: cccorelib.Polyline, state: bool) None
SimpleTriangle
See also
C++: CCCoreLib::SimpleTriangle
- class cccorelib.SimpleTriangle
Bases:
GenericTriangle
- property A
- property B
- property C
SimpleMesh
See also
C++: CCCoreLib::SimpleMesh
- class cccorelib.SimpleMesh
Bases:
GenericIndexedMesh
- addTriangle(self: cccorelib.SimpleMesh, i1: int, i2: int, i3: int) None
- capacity(self: cccorelib.SimpleMesh) int
- clear(self: cccorelib.SimpleMesh) None
- reserve(self: cccorelib.SimpleMesh, n: int) bool
- resize(self: cccorelib.SimpleMesh, n: int) bool
- vertices(self: cccorelib.SimpleMesh) cccorelib.GenericIndexedCloud
KdTrees
KDTree
See also
C++: CCCoreLib::KDTree
- class cccorelib.KDTree
- class IndicesVector
- append(self: cccorelib.KDTree.IndicesVector, x: int) None
Add an item to the end of the list
- clear(self: cccorelib.KDTree.IndicesVector) None
Clear the contents
- count(self: cccorelib.KDTree.IndicesVector, x: int) int
Return the number of times
x
appears in the list
- extend(*args, **kwargs)
Overloaded function.
extend(self: cccorelib.KDTree.IndicesVector, L: cccorelib.KDTree.IndicesVector) -> None
Extend the list by appending all the items in the given list
extend(self: cccorelib.KDTree.IndicesVector, L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(self: cccorelib.KDTree.IndicesVector, i: int, x: int) None
Insert an item at a given position.
- pop(*args, **kwargs)
Overloaded function.
pop(self: cccorelib.KDTree.IndicesVector) -> int
Remove and return the last item
pop(self: cccorelib.KDTree.IndicesVector, i: int) -> int
Remove and return the item at index
i
- remove(self: cccorelib.KDTree.IndicesVector, x: int) None
Remove the first item from the list whose value is x. It is an error if there is no such item.
- buildFromCloud(self: cccorelib.KDTree, cloud: cccorelib.GenericIndexedCloud, progressCb: cccorelib.GenericProgressCallback = None) bool
- findNearestNeighbour(self: cccorelib.KDTree, queryPoint: Sequence, maxDist: float) object
- findNearestNeighbourWithMaxDist(self: cccorelib.KDTree, queryPoint: Sequence, maxDist: float) bool
- getAssociatedCloud(self: cccorelib.KDTree) cccorelib.GenericIndexedCloud
- radiusSearch(self: cccorelib.KDTree, queryPoint: Sequence, distance: float, tolerance: float, points: cccorelib.KDTree.IndicesVector) int
TrueKdTree
See also
C++: CCCoreLib::TrueKdTree
- class cccorelib.TrueKdTree
- associatedCloud(self: cccorelib.TrueKdTree) cccorelib.GenericIndexedCloudPersist
- build(self: cccorelib.TrueKdTree, maxError: float, errorMeasure: cccorelib.DistanceComputationTools.ERRPOR_MEASURES = <ERRPOR_MEASURES.RMS: 0>, minPointCountPerCell: int = 3, maxPointCountPerCell: int = 0, progressCb: cccorelib.GenericProgressCallback = None) bool
- clear(self: cccorelib.TrueKdTree) None
- getLeaves(self: cccorelib.TrueKdTree, leaves: cccorelib.TrueKdTree.LeafVector) bool
- getMaxErrorType(self: cccorelib.TrueKdTree) cccorelib.DistanceComputationTools.ERRPOR_MEASURES
Octrees
GenericOctree
See also
C++: CCCoreLib::GenericOctree
- class cccorelib.GenericOctree
Bases:
pybind11_object
DgmOctree
See also
C++: CCCoreLib::DgmOctree
- class cccorelib.DgmOctree
Bases:
GenericOctree
- class NearestNeighboursSearchStruct
Bases:
pybind11_object
- property alreadyVisitedNeighbourhoodSize
- property cellCenter
- property cellPos
- property level
- property maxSearchSquareDistd
- property minNumberOfNeighbors
- property minimalCellsSetToVisit
- property pointsInNeighbourhood
- property queryPoint
- property theNearestPointIndex
- class NeighbourCellsSet
Bases:
pybind11_object
- append(self: cccorelib.DgmOctree.NeighbourCellsSet, x: cccorelib.DgmOctree.CellDescriptor) None
Add an item to the end of the list
- clear(self: cccorelib.DgmOctree.NeighbourCellsSet) None
Clear the contents
- extend(*args, **kwargs)
Overloaded function.
extend(self: cccorelib.DgmOctree.NeighbourCellsSet, L: cccorelib.DgmOctree.NeighbourCellsSet) -> None
Extend the list by appending all the items in the given list
extend(self: cccorelib.DgmOctree.NeighbourCellsSet, L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(self: cccorelib.DgmOctree.NeighbourCellsSet, i: int, x: cccorelib.DgmOctree.CellDescriptor) None
Insert an item at a given position.
- pop(*args, **kwargs)
Overloaded function.
pop(self: cccorelib.DgmOctree.NeighbourCellsSet) -> cccorelib.DgmOctree.CellDescriptor
Remove and return the last item
pop(self: cccorelib.DgmOctree.NeighbourCellsSet, i: int) -> cccorelib.DgmOctree.CellDescriptor
Remove and return the item at index
i
- class NeighboursSet
Bases:
pybind11_object
- append(self: cccorelib.DgmOctree.NeighboursSet, x: cccorelib.DgmOctree.PointDescriptor) None
Add an item to the end of the list
- clear(self: cccorelib.DgmOctree.NeighboursSet) None
Clear the contents
- extend(*args, **kwargs)
Overloaded function.
extend(self: cccorelib.DgmOctree.NeighboursSet, L: cccorelib.DgmOctree.NeighboursSet) -> None
Extend the list by appending all the items in the given list
extend(self: cccorelib.DgmOctree.NeighboursSet, L: Iterable) -> None
Extend the list by appending all the items in the given list
- insert(self: cccorelib.DgmOctree.NeighboursSet, i: int, x: cccorelib.DgmOctree.PointDescriptor) None
Insert an item at a given position.
- pop(*args, **kwargs)
Overloaded function.
pop(self: cccorelib.DgmOctree.NeighboursSet) -> cccorelib.DgmOctree.PointDescriptor
Remove and return the last item
pop(self: cccorelib.DgmOctree.NeighboursSet, i: int) -> cccorelib.DgmOctree.PointDescriptor
Remove and return the item at index
i
- class PointDescriptor
Bases:
pybind11_object
- static distComp(arg0: cccorelib.DgmOctree.PointDescriptor, arg1: cccorelib.DgmOctree.PointDescriptor) bool
- property point
- property pointIndex
- property squareDistd
- static GET_BIT_SHIFT(level: int) int
- static OCTREE_LENGTH(level: int) int
- build(*args, **kwargs)
Overloaded function.
build(self: cccorelib.DgmOctree, progressCb: cccorelib.GenericProgressCallback = None) -> int
build(self: cccorelib.DgmOctree, octreeMin: cccorelib.CCVector3, octreeMax: cccorelib.CCVector3, pointsMinFilter: cccorelib.CCVector3 = None, pointsMaxFilter: cccorelib.CCVector3 = None, progressCb: cccorelib.GenericProgressCallback = None) -> int
- clear(self: cccorelib.DgmOctree) None
- getBoundingBox(self: cccorelib.DgmOctree, bbMin: cccorelib.CCVector3, bbMax: cccorelib.CCVector3) None
- getCellSize(self: cccorelib.DgmOctree, level: int) float
- getMaxFillIndexes(self: cccorelib.DgmOctree, level: int) int
- getMinFillIndexes(self: cccorelib.DgmOctree, level: int) int
- getNumberOfProjectedPoints(self: cccorelib.DgmOctree) int
- getOctreeMaxs(self: cccorelib.DgmOctree) cccorelib.CCVector3
- getOctreeMins(self: cccorelib.DgmOctree) cccorelib.CCVector3
- INVALID_CELL_CODE = 18446744073709551615
- MAX_OCTREE_LENGTH = 2097152
- MAX_OCTREE_LEVEL = 21
DgmOctreeReferenceCloud
See also
C++: CCCoreLib::DgmOctreeReferenceCloud
- class cccorelib.DgmOctreeReferenceCloud
Bases:
GenericIndexedCloudPersist
- forwardIterator(self: cccorelib.DgmOctreeReferenceCloud) None
Others
BoundingBox
See also
C++: CCCoreLib::BoundingBox
- class cccorelib.BoundingBox
- add(self: cccorelib.BoundingBox, aPoint: cccorelib.CCVector3) None
- clear(self: cccorelib.BoundingBox) None
- computeVolume(self: cccorelib.BoundingBox) float
- contains(self: cccorelib.BoundingBox, P: cccorelib.CCVector3) bool
- getCenter(self: cccorelib.BoundingBox) cccorelib.CCVector3
- getDiagNorm(self: cccorelib.BoundingBox) float
- getDiagNormd(self: cccorelib.BoundingBox) float
- getDiagVec(self: cccorelib.BoundingBox) cccorelib.CCVector3
- getMaxBoxDim(self: cccorelib.BoundingBox) float
- getMinBoxDim(self: cccorelib.BoundingBox) float
- isValid(self: cccorelib.BoundingBox) bool
- maxCorner(self: cccorelib.BoundingBox) cccorelib.CCVector3
- minCorner(self: cccorelib.BoundingBox) cccorelib.CCVector3
- minDistTo(self: cccorelib.BoundingBox, box: cccorelib.BoundingBox) float
- setValidity(self: cccorelib.BoundingBox, state: bool) None
ScalarField
See also
C++: CCCoreLib::ScalarField
- class cccorelib.ScalarField
Bases:
CCShareable
Note
Note that cccorelib.ScalarField uses float while Python only uses doubles which means a loss of precision will happen.
Getting / Setting values can be done via
cccorelib.ScalarField.getValue()
orcccorelib.ScalarField.setValue()
. Alternatively, it is possible to use bracket operator.Use
cccorelib.ScalarField.asArray()
to be able to use the scalar field as a normal numpy array.Example
scalar_field = cccorelib.ScalarField("Codification")
- static NaN() float
- static ValidValue(value: float) bool
- addElement(self: cccorelib.ScalarField, value: float) None
Appends a value
Example
>>> import cccorelib >>> sf = cccorelib.ScalarField("name") >>> sf.size() 0 >>> sf.addElement(1) >>> sf.size() 1
- asArray(self: cccorelib.ScalarField) numpy.ndarray[numpy.float32]
Returns the scalar field viewed as a numpy array.
This does not return a copy, so changes made to the array a reflected in the scalar field (and vice-versa).
scalar_field = cccorelib.ScalarField("Codification") scalar_field.resize(10) array = scalar_field.asArray() assert np.all(array == 0) # Changes made to the scalar_field reflects on the array scalar_field.fill(1.0) assert np.all(array == 1.0) # and vice-versa array[:] = 2.0 assert scalar_field[0] == 2.0
- computeMeanAndVariance(self: cccorelib.ScalarField, mean: float, variance: float = None) None
- computeMinAndMax(self: cccorelib.ScalarField) None
Computes the Min and Max, this needs to be called before retrieving the values with getMin or getMax
- fill(self: cccorelib.ScalarField, fillValue: float = 0) None
Fills the scalar field with the given value
- flagValueAsInvalid(self: cccorelib.ScalarField, index: int) None
- getMax(self: cccorelib.ScalarField) float
Returns the highest value in the scalar field
You need to call
cccorelib.ScalarField.computeMinAndMax()
if the array has changed since last call.
- getMin(self: cccorelib.ScalarField) float
Returns the lowest value in the scalar field
You need to call
cccorelib.ScalarField.computeMinAndMax()
if the array has changed since last call.
- getName(self: cccorelib.ScalarField) str
Returns the name of the scalar field
>>> import cccorelib >>> sf = cccorelib.ScalarField("name") >>> sf.getName() 'name'
- getValue(self: cccorelib.ScalarField, index: int) float
Returns the value at the given index.
Only supports index in [0..self.size()[
- Raises:
IndexError on invalid index –
- reserve(self: cccorelib.ScalarField, count: int) None
Reserves space for
count
element, but does not change the size.Will raise an exception if allocation failed
- reserveSafe(self: cccorelib.ScalarField, count: int) bool
Reserves space for
count
element, but does not change the size.Will NOT raise an exception if allocation failed. Instead, it returns a bool to indicate success.
Prefer use of
cccorelib.ScalarField.reserve()
.
- resize(self: cccorelib.ScalarField, count: int, valueForNewElements: float = 0) None
Resize the scalar field
Will raise an exception if allocation failed
- resizeSafe(self: cccorelib.ScalarField, count: int, initNewElements: bool = False, valueForNewElements: float = 0) bool
Resize the scalar field
Will NOT raise an exception if allocation failed. Instead, it returns a bool to indicate success.
Prefer use of
cccorelib.ScalarField.resize()
.
- setName(self: cccorelib.ScalarField, arg0: str) None
Sets the name of the scalar field
>>> import cccorelib >>> sf = cccorelib.ScalarField("name") >>> sf.setName("other_name") >>> sf.getName() == "other_name" True
- setValue(self: cccorelib.ScalarField, index: int, value: float) None
Sets the value at the given index.
Only supports index in [0..self.size()[
- Raises:
IndexError on invalid index –
- size(self: cccorelib.ScalarField) int
Returns the number of elements (values) in the scalar field