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 {
return sizeof( T ); }
306 virtual inline const std::type_info &
typeId()
const {
return typeid( T ); }
310 virtual inline void clear() { std::vector<T>().
swap( data_ ); }
311 virtual inline void pushback() { data_.push_back( T() ); }
312 virtual inline void resize(
unsigned int _num ) { data_.resize( _num ); }
313 virtual void crop(
const std::vector<int> &_indices );
323 template <
typename T>
333 inline Reference
data() {
return data_; }
334 inline ConstReference
data()
const {
return data_; }
336 virtual inline size_t sizeOf()
const {
return sizeof( T ); }
337 virtual inline const std::type_info &
typeId()
const {
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 void swapPredefinedCloudPropertyPointers(SplatCloud &_splatCloud)
Swap pointers to predefined cloud-properties.
void getPredefinedCloudPropertyPointers()
Get pointers to predefined cloud-properties.
bool requestSelections()
Request the predefined property.
CloudPropertyT< T > * getCloudProperty(const PropertyHandleT< T > &_handle)
Get a pointer to a property.
void copyCloudProperties(const SplatCloud &_splatCloud)
Deep copy all cloud-properties.
CloudPropertyMapEntry(CloudPropertyInterface *_prop, unsigned int _num)
Constructor.
virtual CloudPropertyT< T > * clone() const
Return a deep copy of this.
void releasePositions()
Release the predefined property.
void releaseSelections()
Release the predefined property.
Selection & selections(int _idx)
Get a reference of the predefined property's value.
const SplatPropertyT< T > * getSplatProperty(const BasePropertyHandle &_handle) const
Get a pointer to a property.
bool requestViewlists()
Request the predefined property.
std::vector< T >::const_reference ConstReference
These are used because a std::vector<bool>::reference is not the same as a reference to bool...
bool hasNormals() const
Return the availability of the predefined property.
SplatPropertyMapEntry(SplatPropertyInterface *_prop, unsigned int _num)
Constructor.
SplatCloud()
Standard constructor.
Reference data(int _idx)
Access the data as reference.
int cameraObjectId_
Camera-object id.
virtual void clear()
Clear the data vector.
CloudPropertyT< T > * requestCloudProperty(const PropertyHandleT< T > &_handle)
Request a new property.
CloudPropertyMapEntry()
Standard constructor.
virtual const std::type_info & typeId() const
Get the runtime type information.
unsigned int numRequests_
The number of times requestSplatProperty() was called and has not been released yet.
bool requestIndices()
Request the predefined property.
CloudPropertyT< T > * requestCloudProperty(const BasePropertyHandle &_handle)
Request a new property.
CloudPropertyInterface * property_
A valid pointer to a cloud-property.
float y_
y-coordinate of pixel position
void releaseColors()
Release the predefined property.
const Normal & normals(int _idx) const
Get a reference of the predefined property's value.
void swap(SplatCloud &_splatCloud)
Swap the content.
ConstReference data() const
Access the data as const reference.
Color & colors(int _idx)
Get a reference of the predefined property's value.
bool hasColors() const
Return the availability of the predefined property.
ConstReference data(int _idx) const
Access the data as const reference.
void clearSplatProperties()
Clear all splat-properties.
bool hasPositions() const
Return the availability of the predefined property.
SplatPropertyT< T > * requestSplatProperty(const BasePropertyHandle &_handle)
Request a new property.
Normal & normals(int _idx)
Get a reference of the predefined property's value.
SplatCloud & operator=(const SplatCloud &_splatCloud)
Assign operator.
T data_
The actual stored data.
Add colors to mesh item (vertices/faces/edges)
SplatPropertyMapEntry()
Standard constructor.
bool requestPositions()
Request the predefined property.
virtual void pushback()
Add one element at the end of the data vector.
void releaseViewlists()
Release the predefined property.
const T & ConstReference
These are used only out of a consistency reason to the class SplatPropertyT<T>.
Position & positions(int _idx)
Get a reference of the predefined property's value.
void releaseNormals()
Release the predefined property.
const SplatPropertyMap & splatProperties() const
Get all splat-properties.
void copySplatProperties(const SplatCloud &_splatCloud)
Deep copy all splat-properties.
virtual size_t sizeOf() const
Get the size of type.
CloudPropertyMap cloudProperties_
Cloud-property map.
Index & indices(int _idx)
Get a reference of the predefined property's value.
SplatPropertyT< T > * getSplatProperty(const BasePropertyHandle &_handle)
Get a pointer to a property.
void releaseIndices()
Release the predefined property.
unsigned int numSplats() const
Get the number of splats.
unsigned int numRequests_
The number of times requestCloudProperty() was called and has not been released yet.
virtual size_t sizeOf() const
Get the size of type.
std::vector< T >::reference Reference
These are references to T, not to SplatPropertyT<T>.
const Color & colors(int _idx) const
Get a reference of the predefined property's value.
const Position & positions(int _idx) const
Get a reference of the predefined property's value.
SplatPropertyInterface * property_
A valid pointer to a splat-property.
const Index & indices(int _idx) const
Get a reference of the predefined property's value.
const Selection & selections(int _idx) const
Get a reference of the predefined property's value.
bool hasIndices() const
Return the availability of the predefined property.
const CloudPropertyT< T > * getCloudProperty(const BasePropertyHandle &_handle) const
Get a pointer to a property.
std::string BasePropertyHandle
float x_
x-coordinate of pixel position
void resetPredefinedSplatPropertyPointers()
Reset pointers to predefined splat-properties.
void clearCloudProperties()
Clear all cloud-properties.
void clear()
Remove all properties and reset the number of splats.
const Pointsize & pointsizes(int _idx) const
Get a reference of the predefined property's value.
CloudPropertyT< T > * releaseCloudProperty(const BasePropertyHandle &_handle)
Release a property.
SplatPropertyT< T > * releaseSplatProperty(const PropertyHandleT< T > &_handle)
Release a property.
const CloudPropertyMap & cloudProperties() const
Get all cloud-properties.
virtual void resize(unsigned int _num)
Resize the data vector.
virtual const std::type_info & typeId() const
Get the runtime type information.
unsigned int numSplats_
Number of splats.
SplatPropertyT< T > * requestSplatProperty(const PropertyHandleT< T > &_handle)
Request a new property.
CloudPropertyT< T > * releaseCloudProperty(const PropertyHandleT< T > &_handle)
Release a property.
bool hasSelections() const
Return the availability of the predefined property.
bool requestNormals()
Request the predefined property.
bool requestColors()
Request the predefined property.
Reference data()
Access the data as reference.
virtual SplatPropertyT< T > * clone() const
Return a deep copy of this.
std::vector< T > data_
The actual stored data (one element per splat)
CloudPropertyT< T > * getCloudProperty(const BasePropertyHandle &_handle)
Get a pointer to a property.
bool hasViewlists() const
Return the availability of the predefined property.
SplatPropertyT< T > * releaseSplatProperty(const BasePropertyHandle &_handle)
Release a property.
void getPredefinedSplatPropertyPointers()
Get pointers to predefined splat-properties.
T & Reference
These are references to T, not to CloudPropertyT<T>.
void swapPredefinedSplatPropertyPointers(SplatCloud &_splatCloud)
Swap pointers to predefined splat-properties.
virtual ~SplatPropertyInterface()
Destructor.
const Viewlist & viewlists(int _idx) const
Get a reference of the predefined property's value.
void releasePointsizes()
Release the predefined property.
std::map< BasePropertyHandle, SplatPropertyMapEntry > SplatPropertyMap
bool hasPointsizes() const
Return the availability of the predefined property.
void resetPredefinedCloudPropertyPointers()
Reset pointers to predefined cloud-properties.
std::map< BasePropertyHandle, CloudPropertyMapEntry > CloudPropertyMap
SplatPropertyMap splatProperties_
Splat-property map.
DLLEXPORT DataType typeId(QString _name)
Given a dataType Identifier string this function will return the id of the datatype.
int featureIdx_
SIFT-feature index.
Pointsize & pointsizes(int _idx)
Get a reference of the predefined property's value.
virtual ~CloudPropertyInterface()
Destructor.
SplatPropertyT< T > * getSplatProperty(const PropertyHandleT< T > &_handle)
Get a pointer to a property.
Viewlist & viewlists(int _idx)
Get a reference of the predefined property's value.
bool requestPointsizes()
Request the predefined property.