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