24#ifndef __ODGIPOINTCLOUD_H__
25#define __ODGIPOINTCLOUD_H__
62 kTransparencyComponent = kNumComponents,
68 kTransparencies = (1 << 1),
80 kLastComponentFlag = (1 << (kNumComponents << 1)),
82 kAsyncCall = (kLastComponentFlag << 0),
83 kPartialData = (kLastComponentFlag << 1),
85 kLastFlag = kPartialData
92 if (!pFlags)
return addSet;
93 return *pFlags = (*pFlags & ~(3 << (component << 1))) | addSet;
100 return DataSize((flags >> (component << 1)) & 3);
120 const void *m_pComponent[kNumExtraComponents];
122 bool hasComponent(
long nComponent)
const {
return m_pComponent[nComponent] != NULL; }
124 {
const bool bNeedComponent[kNumExtraComponents] =
125 {
true,
GETBIT(components, kColors),
GETBIT(components, kNormals),
GETBIT(components, kTransparencies) };
126 for (
long nComponent = 0; nComponent < kNumExtraComponents; nComponent++)
127 m_pComponent[nComponent] = (bNeedComponent[nComponent] && comps.
hasComponent(nComponent)) ?
132 const void *pNormals = NULL)
133 { m_pComponent[kVertexComponent] = pPoints; m_pComponent[kColorComponent] = pColors;
134 m_pComponent[kTransparencyComponent] = pTransparencies; m_pComponent[kNormalComponent] = pNormals;
158 {
return (component == kNumComponents) ? 0 : ((component == kColorComponent) ? 2 : 8); }
205 { m_pPrevFilter = pFilter; }
214 {
if (m_pPrevFilter.
isNull() || m_pPrevFilter->
filterPoints(pArrays, nArrays, compFlags, pExtents))
215 return filterPointsImpl(pArrays, nArrays, compFlags, pExtents);
220 return filterBoundingBoxImpl(bb);
224 {
if (!m_pPrevFilter.
isNull())
226 extractTransformImpl(xForm);
229 OdGeMatrix3d xForm; extractTransformImpl(xForm);
return xForm;
309 { m_pFilter = pFilter; }
315 for (
OdUInt32 nArray = 0; nArray < nArrays; nArray++)
316 nPoints += pArrays[nArray].m_nPoints;
328 if (nArrays == 1) pointsCopy = *pArrays, pCopy = &pointsCopy;
329 else if (nArrays > 1) m_comps.
resize(nArrays),
331 if (m_pFilter->
filterPoints(pCopy, nArrays, compFlags, pExtents))
332 return addPointsImpl(pCopy, nArrays, compFlags, nCellId, pExtents);
340 return addPointsFiltered(pArrays, nArrays, compFlags, nCellId, pExtents);
342 return addPointsImpl(pArrays, nArrays, compFlags, nCellId, pExtents);
346 return removePointsImpl(nPoints, nCellId);
368 pObj->attachFilter(pFilter);
const OdGiPointCloudCellId kGiPointCloudNegativeCellId
OdSmartPtr< OdGiPointCloudFilter > OdGiPointCloudFilterPtr
OdSmartPtr< OdGiPointCloudReceiver > OdGiPointCloudReceiverPtr
OdSmartPtr< OdGiPointCloud > OdGiPointCloudPtr
OdUInt64 OdGiPointCloudCellId
#define GETBIT(flags, bit)
const T * asArrayPtr() const
void resize(size_type logicalLength, const T &value)
OdGeEntity3d & transformBy(const OdGeMatrix3d &xfm)
static GE_STATIC_EXPORT const OdGeExtents3d kInvalid
OdGeMatrix3d & setToIdentity()
static GE_STATIC_EXPORT const OdGeMatrix3d kIdentity
OdGeMatrix3d & preMultBy(const OdGeMatrix3d &leftSide)
OdGiPointCloud::ComponentsArray m_comps
virtual bool filterPointsImpl(OdGiPointCloud::ComponentsRaw *&pPoints, OdUInt32 &nArrays, OdUInt32 &compFlags, const OdGeBoundBlock3d *&pExtents) const
OdGiPointCloud::ComponentsArray & components() const
static OdGiPointCloudFilterPtr createObject(OdUInt32 compFlags, const OdGiPointCloudFilter *pPrevFilter=NULL)
void setComponentsRequest(OdUInt32 compFlags)
virtual bool filterBoundingBoxImpl(OdGeBoundBlock3d &bb) const
ODRX_DECLARE_MEMBERS(OdGiPointCloudComponentsFilter)
OdUInt32 componentsRequest() const
const OdGeExtents3d & getExtents() const
static OdGiPointCloudReceiverPtr createObject(const OdGiPointCloudFilter *pFilter)
virtual bool addPointsImpl(const OdGiPointCloud::ComponentsRaw *pArrays, OdUInt32 nArrays, OdUInt32 compFlags, OdGiPointCloudCellId, const OdGeBoundBlock3d *pExtents)
ODRX_DECLARE_MEMBERS(OdGiPointCloudExtentsReceiver)
virtual void extractTransformImpl(OdGeMatrix3d &) const
void attachFilter(const OdGiPointCloudFilter *pFilter)
OdGiPointCloudFilterPtr m_pPrevFilter
ODRX_DECLARE_MEMBERS(OdGiPointCloudFilter)
virtual bool filterBoundingBoxImpl(OdGeBoundBlock3d &bb) const =0
OdGiPointCloudFilterPtr detachFilter()
virtual bool filterPointsImpl(OdGiPointCloud::ComponentsRaw *&pArrays, OdUInt32 &nArrays, OdUInt32 &compFlags, const OdGeBoundBlock3d *&pExtents) const =0
bool filterPoints(OdGiPointCloud::ComponentsRaw *&pArrays, OdUInt32 &nArrays, OdUInt32 &compFlags, const OdGeBoundBlock3d *&pExtents) const
bool filterBoundingBox(OdGeBoundBlock3d &bb) const
OdGeMatrix3d extractTransform() const
virtual OdUInt32 componentsMask() const
virtual bool updatePointsData(OdGiPointCloudReceiver *pReceiver, OdUInt32 components=kNoComponents, OdUInt32 flags=0, const OdGiViewport *pVp=NULL, const OdGiViewport *pVpFrom=NULL, OdUInt32 pointSize=0) const =0
ODRX_DECLARE_MEMBERS(OdGiPointCloud)
virtual bool getExtents(OdGeBoundBlock3d &) const
virtual const OdGeMatrix3d & globalTransform() const
static OdUInt32 getDefaultDataSizeFlags()
virtual bool isDataCompatible(const OdGiViewport &pVp1, const OdGiViewport &pVp2) const =0
virtual bool calculateExtents(OdGeExtents3d &extents, const OdGiPointCloudFilter *pFilter=NULL) const
OdArray< Components > ComponentsArray
static DataSize getDataSizeFlags(OdUInt32 flags, Component component)
virtual OdInt32 defaultPointSize() const
static OdUInt32 addDataSizeFlags(OdUInt32 *pFlags, Component component, DataSize ds)
virtual OdUInt32 supportFlags(Component component=kNumComponents) const
OdArray< ComponentsRaw, OdMemoryAllocator< ComponentsRaw > > ComponentsRawArray
virtual OdUInt32 totalPointsCount() const =0
OdGiPointCloudFilterPtr detachFilter()
OdGiPointCloud::ComponentsRawArray m_comps
OdGiPointCloudFilterPtr m_pFilter
OdUInt32 numPointsTotal(const OdGiPointCloud::ComponentsRaw *pArrays, OdUInt32 nArrays) const
bool removePoints(OdUInt32 nPoints, OdGiPointCloudCellId nCellId=kGiPointCloudNegativeCellId)
virtual bool addPointsImpl(const OdGiPointCloud::ComponentsRaw *pArrays, OdUInt32 nArrays, OdUInt32 compFlags, OdGiPointCloudCellId nCellId, const OdGeBoundBlock3d *pExtents)=0
ODRX_DECLARE_MEMBERS(OdGiPointCloudReceiver)
bool addPoints(const OdGiPointCloud::ComponentsRaw *pArrays, OdUInt32 nArrays, OdUInt32 compFlags, OdGiPointCloudCellId nCellId=kGiPointCloudNegativeCellId, const OdGeBoundBlock3d *pExtents=NULL)
virtual bool removePointsImpl(OdUInt32 nPoints, OdGiPointCloudCellId nCellId)
void attachFilter(const OdGiPointCloudFilter *pFilter)
OdUInt8Array m_component[kNumExtraComponents]
bool hasComponent(long nComponent) const
bool hasComponent(long nComponent) const
ComponentsRaw & construct(const void *pPoints, OdUInt32 nPoints, const void *pColors=NULL, const void *pTransparencies=NULL, const void *pNormals=NULL)
ComponentsRaw & fromComponents(Components &comps, OdUInt32 components=0xFFFFFFFF)