68 #include <ACG/Math/VectorT.hh> 89 resetPredefinedSplatPropertyPointers();
90 resetPredefinedCloudPropertyPointers();
122 void pushbackSplat();
132 void resizeSplats(
unsigned int _num );
145 template <
typename T>
unsigned int eraseSplatsByIndex(
const T &_indices );
159 template <
typename T>
unsigned int eraseSplatsByFlag(
const std::vector<T> &_flags );
171 template <
typename T>
void cropSplats(
const T &_indices );
179 inline unsigned int numSplats()
const {
return numSplats_; }
212 virtual size_t sizeOf()
const = 0;
213 virtual const std::type_info &
typeId()
const = 0;
217 virtual void clear() = 0;
218 virtual void pushback() = 0;
219 virtual void resize(
unsigned int _num ) = 0;
220 virtual void crop(
const std::vector<int> &_indices ) = 0;
232 virtual size_t sizeOf()
const = 0;
233 virtual const std::type_info &
typeId()
const = 0;
282 template <
typename T>
286 explicit inline PropertyHandleT<T>(
const BasePropertyHandle &_handle ) : BasePropertyHandle( _handle ) { }
292 template <
typename T>
302 inline Reference
data(
int _idx ) {
return data_[ _idx ]; }
303 inline ConstReference
data(
int _idx )
const {
return data_[ _idx ]; }
305 virtual inline size_t sizeOf()
const override {
return sizeof( T ); }
306 virtual inline const std::type_info &
typeId()
const override {
return typeid( T ); }
310 virtual inline void clear()
override { std::vector<T>().
swap( data_ ); }
311 virtual inline void pushback()
override { data_.push_back( T() ); }
312 virtual inline void resize(
unsigned int _num )
override { data_.resize( _num ); }
313 virtual void crop(
const std::vector<int> &_indices )
override;
323 template <
typename T>
333 inline Reference
data() {
return data_; }
334 inline ConstReference
data()
const {
return data_; }
336 virtual inline size_t sizeOf()
const override {
return sizeof( T ); }
337 virtual inline const std::type_info &
typeId()
const override {
return typeid( T ); }
511 typedef float Pointsize;
513 typedef std::vector<View> Viewlist;
514 typedef unsigned char Selection;
520 typedef std::vector<Position > PositionVector;
522 typedef std::vector<Color > ColorVector;
523 typedef std::vector<Normal > NormalVector;
524 typedef std::vector<Pointsize> PointsizeVector;
525 typedef std::vector<Index > IndexVector;
526 typedef std::vector<Viewlist > ViewlistVector;
527 typedef std::vector<Selection> SelectionVector;
606 inline bool hasPositions()
const {
return (positionsProperty_ != 0); }
608 inline bool hasColors()
const {
return (colorsProperty_ != 0); }
609 inline bool hasNormals()
const {
return (normalsProperty_ != 0); }
611 inline bool hasIndices()
const {
return (indicesProperty_ != 0); }
630 inline Position &
positions (
int _idx ) {
return positionsProperty_-> data( _idx ); }
632 inline const Position &
positions (
int _idx )
const {
return positionsProperty_-> data( _idx ); }
633 inline Color &
colors (
int _idx ) {
return colorsProperty_-> data( _idx ); }
634 inline const Color &
colors (
int _idx )
const {
return colorsProperty_-> data( _idx ); }
635 inline Normal &
normals (
int _idx ) {
return normalsProperty_-> data( _idx ); }
636 inline const Normal &
normals (
int _idx )
const {
return normalsProperty_-> data( _idx ); }
637 inline Pointsize &
pointsizes(
int _idx ) {
return pointsizesProperty_->data( _idx ); }
638 inline const Pointsize &
pointsizes(
int _idx )
const {
return pointsizesProperty_->data( _idx ); }
639 inline Index &
indices (
int _idx ) {
return indicesProperty_-> data( _idx ); }
640 inline const Index &
indices (
int _idx )
const {
return indicesProperty_-> data( _idx ); }
641 inline Viewlist &
viewlists (
int _idx ) {
return viewlistsProperty_-> data( _idx ); }
642 inline const Viewlist &
viewlists (
int _idx )
const {
return viewlistsProperty_-> data( _idx ); }
643 inline Selection &
selections(
int _idx ) {
return selectionsProperty_->data( _idx ); }
644 inline const Selection &
selections(
int _idx )
const {
return selectionsProperty_->data( _idx ); }
656 positionsProperty_ = 0;
658 normalsProperty_ = 0;
659 pointsizesProperty_ = 0;
660 indicesProperty_ = 0;
661 viewlistsProperty_ = 0;
662 selectionsProperty_ = 0;
686 std::swap( positionsProperty_, _splatCloud.positionsProperty_ );
687 std::swap( colorsProperty_, _splatCloud.colorsProperty_ );
688 std::swap( normalsProperty_, _splatCloud.normalsProperty_ );
689 std::swap( pointsizesProperty_, _splatCloud.pointsizesProperty_ );
690 std::swap( indicesProperty_, _splatCloud.indicesProperty_ );
691 std::swap( viewlistsProperty_, _splatCloud.viewlistsProperty_ );
692 std::swap( selectionsProperty_, _splatCloud.selectionsProperty_ );
716 static const PositionsHandle POSITIONS_HANDLE;
718 static const ColorsHandle COLORS_HANDLE;
719 static const NormalsHandle NORMALS_HANDLE;
720 static const PointsizesHandle POINTSIZES_HANDLE;
721 static const IndicesHandle INDICES_HANDLE;
722 static const ViewlistsHandle VIEWLISTS_HANDLE;
723 static const SelectionsHandle SELECTIONS_HANDLE;
734 #if defined(INCLUDE_TEMPLATES) && !defined(SPLATCLOUDT_CC) 735 # include "SplatCloudT_impl.hh" 742 #endif // SPLATCLOUD_HH bool requestSelections()
Request the predefined property.
SplatPropertyT< T > * requestSplatProperty(const PropertyHandleT< T > &_handle)
Request a new property.
const Selection & selections(int _idx) const
Get a reference of the predefined property's value.
Position & positions(int _idx)
Get a reference of the predefined property's value.
virtual ~CloudPropertyInterface()
Destructor.
const CloudPropertyT< T > * getCloudProperty(const BasePropertyHandle &_handle) const
Get a pointer to a property.
SplatCloud()
Standard constructor.
virtual SplatPropertyT< T > * clone() const override
Return a deep copy of this.
const Index & indices(int _idx) const
Get a reference of the predefined property's value.
ConstReference data(int _idx) const
Access the data as const reference.
void swapPredefinedCloudPropertyPointers(SplatCloud &_splatCloud)
Swap pointers to predefined cloud-properties.
unsigned int numSplats() const
Get the number of splats.
const CloudPropertyMap & cloudProperties() const
Get all cloud-properties.
virtual CloudPropertyT< T > * clone() const override
Return a deep copy of this.
CloudPropertyMapEntry(CloudPropertyInterface *_prop, unsigned int _num)
Constructor.
Color & colors(int _idx)
Get a reference of the predefined property's value.
virtual const std::type_info & typeId() const override
Get the runtime type information.
CloudPropertyT< T > * requestCloudProperty(const BasePropertyHandle &_handle)
Request a new property.
bool hasSelections() const
Return the availability of the predefined property.
virtual size_t sizeOf() const override
Get the size of type.
std::vector< T > data_
The actual stored data (one element per splat)
virtual void resize(unsigned int _num) override
Resize the data vector.
CloudPropertyMap cloudProperties_
Cloud-property map.
void clearCloudProperties()
Clear all cloud-properties.
const Position & positions(int _idx) const
Get a reference of the predefined property's value.
void releasePointsizes()
Release the predefined property.
CloudPropertyInterface * property_
A valid pointer to a cloud-property.
std::map< BasePropertyHandle, SplatPropertyMapEntry > SplatPropertyMap
bool hasViewlists() const
Return the availability of the predefined property.
bool requestPositions()
Request the predefined property.
CloudPropertyT< T > * requestCloudProperty(const PropertyHandleT< T > &_handle)
Request a new property.
SplatPropertyT< T > * releaseSplatProperty(const BasePropertyHandle &_handle)
Release a property.
std::string BasePropertyHandle
bool hasPositions() const
Return the availability of the predefined property.
unsigned int numRequests_
The number of times requestCloudProperty() was called and has not been released yet.
const SplatPropertyMap & splatProperties() const
Get all splat-properties.
bool hasColors() const
Return the availability of the predefined property.
std::map< BasePropertyHandle, CloudPropertyMapEntry > CloudPropertyMap
virtual const std::type_info & typeId() const override
Get the runtime type information.
void releasePositions()
Release the predefined property.
const T & ConstReference
These are used only out of a consistency reason to the class SplatPropertyT<T>.
T & Reference
These are references to T, not to CloudPropertyT<T>.
Add colors to mesh item (vertices/faces/edges)
SplatPropertyT< T > * getSplatProperty(const BasePropertyHandle &_handle)
Get a pointer to a property.
int featureIdx_
SIFT-feature index.
bool requestColors()
Request the predefined property.
SplatPropertyT< T > * releaseSplatProperty(const PropertyHandleT< T > &_handle)
Release a property.
const Pointsize & pointsizes(int _idx) const
Get a reference of the predefined property's value.
virtual void pushback() override
Add one element at the end of the data vector.
int cameraObjectId_
Camera-object id.
Selection & selections(int _idx)
Get a reference of the predefined property's value.
Normal & normals(int _idx)
Get a reference of the predefined property's value.
SplatCloud & operator=(const SplatCloud &_splatCloud)
Assign operator.
const SplatPropertyT< T > * getSplatProperty(const BasePropertyHandle &_handle) const
Get a pointer to a property.
bool requestPointsizes()
Request the predefined property.
virtual void clear() override
Clear the data vector.
void swapPredefinedSplatPropertyPointers(SplatCloud &_splatCloud)
Swap pointers to predefined splat-properties.
Pointsize & pointsizes(int _idx)
Get a reference of the predefined property's value.
SplatPropertyMap splatProperties_
Splat-property map.
bool hasNormals() const
Return the availability of the predefined property.
bool hasIndices() const
Return the availability of the predefined property.
SplatPropertyMapEntry()
Standard constructor.
const Color & colors(int _idx) const
Get a reference of the predefined property's value.
bool requestIndices()
Request the predefined property.
void copySplatProperties(const SplatCloud &_splatCloud)
Deep copy all splat-properties.
void getPredefinedSplatPropertyPointers()
Get pointers to predefined splat-properties.
SplatPropertyMapEntry(SplatPropertyInterface *_prop, unsigned int _num)
Constructor.
bool requestViewlists()
Request the predefined property.
void releaseNormals()
Release the predefined property.
void clear()
Remove all properties and reset the number of splats.
SplatPropertyT< T > * requestSplatProperty(const BasePropertyHandle &_handle)
Request a new property.
CloudPropertyT< T > * getCloudProperty(const PropertyHandleT< T > &_handle)
Get a pointer to a property.
unsigned int numSplats_
Number of splats.
void swap(SplatCloud &_splatCloud)
Swap the content.
Viewlist & viewlists(int _idx)
Get a reference of the predefined property's value.
Reference data(int _idx)
Access the data as reference.
void releaseSelections()
Release the predefined property.
void releaseColors()
Release the predefined property.
float y_
y-coordinate of pixel position
void getPredefinedCloudPropertyPointers()
Get pointers to predefined cloud-properties.
void copyCloudProperties(const SplatCloud &_splatCloud)
Deep copy all cloud-properties.
void releaseViewlists()
Release the predefined property.
std::vector< T >::reference Reference
These are references to T, not to SplatPropertyT<T>.
CloudPropertyMapEntry()
Standard constructor.
T data_
The actual stored data.
SplatPropertyInterface * property_
A valid pointer to a splat-property.
ConstReference data() const
Access the data as const reference.
std::vector< T >::const_reference ConstReference
These are used because a std::vector<bool>::reference is not the same as a reference to bool...
virtual ~SplatPropertyInterface()
Destructor.
SplatPropertyT< T > * getSplatProperty(const PropertyHandleT< T > &_handle)
Get a pointer to a property.
void resetPredefinedCloudPropertyPointers()
Reset pointers to predefined cloud-properties.
CloudPropertyT< T > * getCloudProperty(const BasePropertyHandle &_handle)
Get a pointer to a property.
void releaseIndices()
Release the predefined property.
void clearSplatProperties()
Clear all splat-properties.
bool hasPointsizes() const
Return the availability of the predefined property.
void resetPredefinedSplatPropertyPointers()
Reset pointers to predefined splat-properties.
CloudPropertyT< T > * releaseCloudProperty(const PropertyHandleT< T > &_handle)
Release a property.
Index & indices(int _idx)
Get a reference of the predefined property's value.
const Viewlist & viewlists(int _idx) const
Get a reference of the predefined property's value.
Reference data()
Access the data as reference.
float x_
x-coordinate of pixel position
bool requestNormals()
Request the predefined property.
virtual size_t sizeOf() const override
Get the size of type.
const Normal & normals(int _idx) const
Get a reference of the predefined property's value.
DLLEXPORT DataType typeId(QString _name)
Given a dataType Identifier string this function will return the id of the datatype.
CloudPropertyT< T > * releaseCloudProperty(const BasePropertyHandle &_handle)
Release a property.
unsigned int numRequests_
The number of times requestSplatProperty() was called and has not been released yet.