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