74 #include <ACG/Math/VectorT.hh>
95 resetPredefinedSplatPropertyPointers();
96 resetPredefinedCloudPropertyPointers();
128 void pushbackSplat();
138 void resizeSplats(
unsigned int _num );
151 template <
typename T>
unsigned int eraseSplatsByIndex(
const T &_indices );
165 template <
typename T>
unsigned int eraseSplatsByFlag(
const std::vector<T> &_flags );
177 template <
typename T>
void cropSplats(
const T &_indices );
185 inline unsigned int numSplats()
const {
return numSplats_; }
218 virtual size_t sizeOf()
const = 0;
219 virtual const std::type_info &
typeId()
const = 0;
223 virtual void clear() = 0;
224 virtual void pushback() = 0;
225 virtual void resize(
unsigned int _num ) = 0;
226 virtual void crop(
const std::vector<int> &_indices ) = 0;
238 virtual size_t sizeOf()
const = 0;
239 virtual const std::type_info &
typeId()
const = 0;
288 template <
typename T>
292 explicit inline PropertyHandleT<T>(
const BasePropertyHandle &_handle ) : BasePropertyHandle( _handle ) { }
298 template <
typename T>
308 inline Reference
data(
int _idx ) {
return data_[ _idx ]; }
309 inline ConstReference
data(
int _idx )
const {
return data_[ _idx ]; }
311 virtual inline size_t sizeOf()
const {
return sizeof( T ); }
312 virtual inline const std::type_info &
typeId()
const {
return typeid( T ); }
316 virtual inline void clear() { std::vector<T>().
swap( data_ ); }
317 virtual inline void pushback() { data_.push_back( T() ); }
318 virtual inline void resize(
unsigned int _num ) { data_.resize( _num ); }
319 virtual void crop(
const std::vector<int> &_indices );
329 template <
typename T>
339 inline Reference
data() {
return data_; }
340 inline ConstReference
data()
const {
return data_; }
342 virtual inline size_t sizeOf()
const {
return sizeof( T ); }
343 virtual inline const std::type_info &
typeId()
const {
return typeid( T ); }
517 typedef float Pointsize;
519 typedef std::vector<View> Viewlist;
520 typedef unsigned char Selection;
526 typedef std::vector<Position > PositionVector;
528 typedef std::vector<Color > ColorVector;
529 typedef std::vector<Normal > NormalVector;
530 typedef std::vector<Pointsize> PointsizeVector;
531 typedef std::vector<Index > IndexVector;
532 typedef std::vector<Viewlist > ViewlistVector;
533 typedef std::vector<Selection> SelectionVector;
612 inline bool hasPositions()
const {
return (positionsProperty_ != 0); }
614 inline bool hasColors()
const {
return (colorsProperty_ != 0); }
615 inline bool hasNormals()
const {
return (normalsProperty_ != 0); }
617 inline bool hasIndices()
const {
return (indicesProperty_ != 0); }
636 inline Position &
positions (
int _idx ) {
return positionsProperty_-> data( _idx ); }
638 inline const Position &
positions (
int _idx )
const {
return positionsProperty_-> data( _idx ); }
639 inline Color &
colors (
int _idx ) {
return colorsProperty_-> data( _idx ); }
640 inline const Color &
colors (
int _idx )
const {
return colorsProperty_-> data( _idx ); }
641 inline Normal &
normals (
int _idx ) {
return normalsProperty_-> data( _idx ); }
642 inline const Normal &
normals (
int _idx )
const {
return normalsProperty_-> data( _idx ); }
643 inline Pointsize &
pointsizes(
int _idx ) {
return pointsizesProperty_->data( _idx ); }
644 inline const Pointsize &
pointsizes(
int _idx )
const {
return pointsizesProperty_->data( _idx ); }
645 inline Index &
indices (
int _idx ) {
return indicesProperty_-> data( _idx ); }
646 inline const Index &
indices (
int _idx )
const {
return indicesProperty_-> data( _idx ); }
647 inline Viewlist &
viewlists (
int _idx ) {
return viewlistsProperty_-> data( _idx ); }
648 inline const Viewlist &
viewlists (
int _idx )
const {
return viewlistsProperty_-> data( _idx ); }
649 inline Selection &
selections(
int _idx ) {
return selectionsProperty_->data( _idx ); }
650 inline const Selection &
selections(
int _idx )
const {
return selectionsProperty_->data( _idx ); }
662 positionsProperty_ = 0;
664 normalsProperty_ = 0;
665 pointsizesProperty_ = 0;
666 indicesProperty_ = 0;
667 viewlistsProperty_ = 0;
668 selectionsProperty_ = 0;
692 std::swap( positionsProperty_, _splatCloud.positionsProperty_ );
693 std::swap( colorsProperty_, _splatCloud.colorsProperty_ );
694 std::swap( normalsProperty_, _splatCloud.normalsProperty_ );
695 std::swap( pointsizesProperty_, _splatCloud.pointsizesProperty_ );
696 std::swap( indicesProperty_, _splatCloud.indicesProperty_ );
697 std::swap( viewlistsProperty_, _splatCloud.viewlistsProperty_ );
698 std::swap( selectionsProperty_, _splatCloud.selectionsProperty_ );
709 SplatPropertyT<Position> *positionsProperty_;
711 SplatPropertyT<Color> *colorsProperty_;
712 SplatPropertyT<Normal> *normalsProperty_;
713 SplatPropertyT<Pointsize> *pointsizesProperty_;
714 SplatPropertyT<Index> *indicesProperty_;
715 SplatPropertyT<Viewlist> *viewlistsProperty_;
716 SplatPropertyT<Selection> *selectionsProperty_;
722 static const PositionsHandle POSITIONS_HANDLE;
724 static const ColorsHandle COLORS_HANDLE;
725 static const NormalsHandle NORMALS_HANDLE;
726 static const PointsizesHandle POINTSIZES_HANDLE;
727 static const IndicesHandle INDICES_HANDLE;
728 static const ViewlistsHandle VIEWLISTS_HANDLE;
729 static const SelectionsHandle SELECTIONS_HANDLE;
740 #if defined(INCLUDE_TEMPLATES) && !defined(SPLATCLOUDT_CC)
741 # include "SplatCloudT.cc"
748 #endif // SPLATCLOUD_HH
virtual SplatPropertyT< T > * clone() const
Return a deep copy of this.
bool requestPositions()
Request the predefined property.
std::vector< T > data_
The actual stored data (one element per splat)
void copySplatProperties(const SplatCloud &_splatCloud)
Deep copy all splat-properties.
void releaseIndices()
Release the predefined property.
void releaseSelections()
Release the predefined property.
SplatPropertyMapEntry(SplatPropertyInterface *_prop, unsigned int _num)
Constructor.
void releaseViewlists()
Release the predefined property.
const Pointsize & pointsizes(int _idx) const
Get a reference of the predefined property's value.
const Normal & normals(int _idx) const
Get a reference of the predefined property's value.
Selection & selections(int _idx)
Get a reference of the predefined property's value.
SplatCloud()
Standard constructor.
void swap(SplatCloud &_splatCloud)
Swap the content.
void releaseColors()
Release the predefined property.
void clearSplatProperties()
Clear all splat-properties.
void releasePointsizes()
Release the predefined property.
void swapPredefinedCloudPropertyPointers(SplatCloud &_splatCloud)
Swap pointers to predefined cloud-properties.
Pointsize & pointsizes(int _idx)
Get a reference of the predefined property's value.
CloudPropertyT< T > * releaseCloudProperty(const BasePropertyHandle &_handle)
Release a property.
Add normals to mesh item (vertices/faces)
bool requestColors()
Request the predefined property.
float x_
x-coordinate of pixel position
std::vector< T >::reference Reference
These are references to T, not to SplatPropertyT.
const T & ConstReference
These are used only out of a consistency reason to the class SplatPropertyT.
const Color & colors(int _idx) const
Get a reference of the predefined property's value.
Index & indices(int _idx)
Get a reference of the predefined property's value.
int featureIdx_
SIFT-feature index.
SplatCloud & operator=(const SplatCloud &_splatCloud)
Assign operator.
CloudPropertyMapEntry(CloudPropertyInterface *_prop, unsigned int _num)
Constructor.
void resetPredefinedCloudPropertyPointers()
Reset pointers to predefined cloud-properties.
CloudPropertyT< T > * requestCloudProperty(const PropertyHandleT< T > &_handle)
Request a new property.
int cameraObjectId_
Camera-object id.
virtual void resize(unsigned int _num)
Resize the data vector.
std::map< BasePropertyHandle, SplatPropertyMapEntry > SplatPropertyMap
void resetPredefinedSplatPropertyPointers()
Reset pointers to predefined splat-properties.
virtual ~CloudPropertyInterface()
Destructor.
virtual CloudPropertyT< T > * clone() const
Return a deep copy of this.
SplatPropertyT< T > * getSplatProperty(const PropertyHandleT< T > &_handle)
Get a pointer to a property.
const Viewlist & viewlists(int _idx) const
Get a reference of the predefined property's value.
virtual ~SplatPropertyInterface()
Destructor.
bool requestSelections()
Request the predefined property.
T & Reference
These are references to T, not to CloudPropertyT.
Normal & normals(int _idx)
Get a reference of the predefined property's value.
bool requestNormals()
Request the predefined property.
CloudPropertyT< T > * getCloudProperty(const BasePropertyHandle &_handle)
Get a pointer to a property.
SplatPropertyT< T > * releaseSplatProperty(const BasePropertyHandle &_handle)
Release a property.
bool requestViewlists()
Request the predefined property.
std::vector< T >::const_reference ConstReference
These are used because a std::vector::reference is not the same as a reference to bool...
virtual size_t sizeOf() const
Get the size of type.
bool hasSelections() const
Return the availability of the predefined property.
std::map< BasePropertyHandle, CloudPropertyMapEntry > CloudPropertyMap
bool hasViewlists() const
Return the availability of the predefined property.
CloudPropertyMap cloudProperties_
Cloud-property map.
void clear()
Remove all properties and reset the number of splats.
unsigned int numSplats_
Number of splats.
void swapPredefinedSplatPropertyPointers(SplatCloud &_splatCloud)
Swap pointers to predefined splat-properties.
ConstReference data(int _idx) const
Access the data as const reference.
const CloudPropertyT< T > * getCloudProperty(const BasePropertyHandle &_handle) const
Get a pointer to a property.
void getPredefinedSplatPropertyPointers()
Get pointers to predefined splat-properties.
std::string BasePropertyHandle
bool requestIndices()
Request the predefined property.
float y_
y-coordinate of pixel position
SplatPropertyMap splatProperties_
Splat-property map.
SplatPropertyT< T > * releaseSplatProperty(const PropertyHandleT< T > &_handle)
Release a property.
bool hasIndices() const
Return the availability of the predefined property.
DLLEXPORT DataType typeId(QString _name)
Given a dataType Identifier string this function will return the id of the datatype.
virtual size_t sizeOf() const
Get the size of type.
const CloudPropertyMap & cloudProperties() const
Get all cloud-properties.
T data_
The actual stored data.
The property handle, use it to access the properties.
SplatPropertyMapEntry()
Standard constructor.
Viewlist & viewlists(int _idx)
Get a reference of the predefined property's value.
virtual const std::type_info & typeId() const
Get the runtime type information.
bool hasColors() const
Return the availability of the predefined property.
bool hasNormals() const
Return the availability of the predefined property.
const SplatPropertyMap & splatProperties() const
Get all splat-properties.
CloudPropertyT< T > * releaseCloudProperty(const PropertyHandleT< T > &_handle)
Release a property.
SplatPropertyT< T > * getSplatProperty(const BasePropertyHandle &_handle)
Get a pointer to a property.
const Selection & selections(int _idx) const
Get a reference of the predefined property's value.
unsigned int numSplats() const
Get the number of splats.
ConstReference data() const
Access the data as const reference.
void getPredefinedCloudPropertyPointers()
Get pointers to predefined cloud-properties.
bool requestPointsizes()
Request the predefined property.
bool hasPointsizes() const
Return the availability of the predefined property.
void releasePositions()
Release the predefined property.
CloudPropertyInterface * property_
A valid pointer to a cloud-property.
Position & positions(int _idx)
Get a reference of the predefined property's value.
CloudPropertyT< T > * getCloudProperty(const PropertyHandleT< T > &_handle)
Get a pointer to a property.
SplatPropertyT< T > * requestSplatProperty(const BasePropertyHandle &_handle)
Request a new property.
CloudPropertyT< T > * requestCloudProperty(const BasePropertyHandle &_handle)
Request a new property.
SplatPropertyInterface * property_
A valid pointer to a splat-property.
virtual void pushback()
Add one element at the end of the data vector.
const SplatPropertyT< T > * getSplatProperty(const BasePropertyHandle &_handle) const
Get a pointer to a property.
CloudPropertyMapEntry()
Standard constructor.
virtual void clear()
Clear the data vector.
void copyCloudProperties(const SplatCloud &_splatCloud)
Deep copy all cloud-properties.
void releaseNormals()
Release the predefined property.
Add colors to mesh item (vertices/faces/edges)
void clearCloudProperties()
Clear all cloud-properties.
Reference data(int _idx)
Access the data as reference.
bool hasPositions() const
Return the availability of the predefined property.
virtual const std::type_info & typeId() const
Get the runtime type information.
Color & colors(int _idx)
Get a reference of the predefined property's value.
const Position & positions(int _idx) const
Get a reference of the predefined property's value.
unsigned int numRequests_
The number of times requestCloudProperty() was called and has not been released yet.
SplatPropertyT< T > * requestSplatProperty(const PropertyHandleT< T > &_handle)
Request a new property.
Reference data()
Access the data as reference.
const Index & indices(int _idx) const
Get a reference of the predefined property's value.
unsigned int numRequests_
The number of times requestSplatProperty() was called and has not been released yet.