Developer Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
SplatCloud.hh
1 /*===========================================================================*\
2 * *
3 * OpenFlipper *
4  * Copyright (c) 2001-2015, RWTH-Aachen University *
5  * Department of Computer Graphics and Multimedia *
6  * All rights reserved. *
7  * www.openflipper.org *
8  * *
9  *---------------------------------------------------------------------------*
10  * This file is part of OpenFlipper. *
11  *---------------------------------------------------------------------------*
12  * *
13  * Redistribution and use in source and binary forms, with or without *
14  * modification, are permitted provided that the following conditions *
15  * are met: *
16  * *
17  * 1. Redistributions of source code must retain the above copyright notice, *
18  * this list of conditions and the following disclaimer. *
19  * *
20  * 2. Redistributions in binary form must reproduce the above copyright *
21  * notice, this list of conditions and the following disclaimer in the *
22  * documentation and/or other materials provided with the distribution. *
23  * *
24  * 3. Neither the name of the copyright holder nor the names of its *
25  * contributors may be used to endorse or promote products derived from *
26  * this software without specific prior written permission. *
27  * *
28  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
29  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
30  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
31  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
32  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
33  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
34  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
35  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
36  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
37  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
38  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
39 * *
40 \*===========================================================================*/
41 
42 /*===========================================================================*\
43 * *
44 * $Revision$ *
45 * $LastChangedBy$ *
46 * $Date$ *
47 * *
48 \*===========================================================================*/
49 
50 //================================================================
51 //
52 // CLASS SplatCloud
53 //
54 // SplatCloud stores the actual data for a SplatCloud.
55 //
56 //================================================================
57 
58 
59 #ifndef SPLATCLOUD_HH
60 #define SPLATCLOUD_HH
61 
62 
63 //== INCLUDES ====================================================
64 
65 
67 
68 #include <typeinfo>
69 #include <string>
70 #include <map>
71 #include <vector>
72 #include <algorithm>
73 
74 #include <ACG/Math/VectorT.hh>
75 
76 
77 //== CLASS DEFINITION ============================================
78 
79 
86 {
87 
88  // == DECLARATIONS =====================================================
89 
90 public:
91 
93  inline SplatCloud() : numSplats_( 0 )
94  {
95  resetPredefinedSplatPropertyPointers();
96  resetPredefinedCloudPropertyPointers();
97  }
98 
100  SplatCloud( const SplatCloud &_splatCloud );
101 
103  inline ~SplatCloud() { clear(); }
104 
106  inline SplatCloud &operator=( const SplatCloud &_splatCloud ) { SplatCloud temp( _splatCloud ); swap( temp ); return *this; }
107 
109  void clear();
110 
112  void swap( SplatCloud &_splatCloud );
113 
114  //----------------
115 
120  void clearSplats();
121 
122  //----------------
123 
128  void pushbackSplat();
129 
130  //----------------
131 
138  void resizeSplats( unsigned int _num );
139 
140  //----------------
141 
151  template <typename T> unsigned int eraseSplatsByIndex( const T &_indices );
152 
153  //----------------
154 
165  template <typename T> unsigned int eraseSplatsByFlag( const std::vector<T> &_flags );
166 
167  //----------------
168 
177  template <typename T> void cropSplats( const T &_indices );
178 
179  //----------------
180 
185  inline unsigned int numSplats() const { return numSplats_; }
186 
187  // == MEMBERS =====================================================
188 
189 private:
190 
192  unsigned int numSplats_;
193 
194  //----------------------------------------------------------------
195 
196 
197 
198  // +------------------------+
199  // | |
200  // | General Properties |
201  // | |
202  // +------------------------+
203 
204  // == TYPEDEFS =====================================================
205 
206 public:
207 
209  typedef std::string BasePropertyHandle;
210 
211  //----------------
212 
215  {
216  friend class SplatCloud;
217  public:
218  virtual size_t sizeOf() const = 0;
219  virtual const std::type_info &typeId() const = 0;
220  private:
221  virtual inline ~SplatPropertyInterface() { }
222  virtual SplatPropertyInterface *clone() 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;
227  private:
228  void operator=( const SplatPropertyInterface & );
229  };
230 
231  //----------------
232 
235  {
236  friend class SplatCloud;
237  public:
238  virtual size_t sizeOf() const = 0;
239  virtual const std::type_info &typeId() const = 0;
240  private:
241  virtual inline ~CloudPropertyInterface() { }
242  virtual CloudPropertyInterface *clone() const = 0;
243  private:
244  void operator=( const CloudPropertyInterface & );
245  };
246 
247  //----------------
248 
251  {
252  public:
253  SplatPropertyMapEntry() : property_( 0 ), numRequests_( 0 ) { }
254  SplatPropertyMapEntry( SplatPropertyInterface *_prop, unsigned int _num ) : property_( _prop ), numRequests_( _num ) { }
255  public:
257  unsigned int numRequests_;
258  };
259 
260  //----------------
261 
264  {
265  public:
266  CloudPropertyMapEntry() : property_( 0 ), numRequests_( 0 ) { }
267  CloudPropertyMapEntry( CloudPropertyInterface *_prop, unsigned int _num ) : property_( _prop ), numRequests_( _num ) { }
268  public:
270  unsigned int numRequests_;
271  };
272 
273  //----------------
274 
276  typedef std::map<BasePropertyHandle, SplatPropertyMapEntry> SplatPropertyMap;
277 
278  //----------------
279 
281  typedef std::map<BasePropertyHandle, CloudPropertyMapEntry> CloudPropertyMap;
282 
283  //----------------
284 
285 public:
286 
288  template <typename T>
289  class PropertyHandleT : public BasePropertyHandle
290  {
291  public:
292  explicit inline PropertyHandleT<T>( const BasePropertyHandle &_handle ) : BasePropertyHandle( _handle ) { }
293  };
294 
295  //----------------
296 
298  template <typename T>
300  {
301  friend class SplatCloud;
302  public:
303  typedef T Value;
304  typedef typename std::vector<T>:: reference Reference;
305  typedef typename std::vector<T>::const_reference ConstReference;
306  public:
307  explicit inline SplatPropertyT<T>( const PropertyHandleT<T> &_handle, unsigned int _num ) : data_( _num ) { }
308  inline Reference data( int _idx ) { return data_[ _idx ]; }
309  inline ConstReference data( int _idx ) const { return data_[ _idx ]; }
310  public:
311  virtual inline size_t sizeOf() const { return sizeof( T ); }
312  virtual inline const std::type_info &typeId() const { return typeid( T ); }
313  private:
314  virtual inline ~SplatPropertyT<T>() { }
315  virtual inline SplatPropertyT<T> *clone() const { return new SplatPropertyT<T>( *this ); }
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 );
320  private:
321  void operator=( const SplatPropertyT<T> & );
322  private:
323  std::vector<T> data_;
324  };
325 
326  //----------------
327 
329  template <typename T>
331  {
332  friend class SplatCloud;
333  public:
334  typedef T Value;
335  typedef T & Reference;
336  typedef const T & ConstReference;
337  public:
338  explicit inline CloudPropertyT<T>( const PropertyHandleT<T> &_handle ) { }
339  inline Reference data() { return data_; }
340  inline ConstReference data() const { return data_; }
341  public:
342  virtual inline size_t sizeOf() const { return sizeof( T ); }
343  virtual inline const std::type_info &typeId() const { return typeid( T ); }
344  private:
345  virtual inline ~CloudPropertyT<T>() { }
346  virtual inline CloudPropertyT<T> *clone() const { return new CloudPropertyT<T>( *this ); }
347  private:
348  void operator=( const CloudPropertyT<T> & );
349  private:
350  T data_;
351  };
352 
353  //-- DECLARATIONS ------------------------------------------------
354 
355 public:
356 
358  void clearSplatProperties();
359 
361  void clearCloudProperties();
362 
363  //----------------
364 
366 
380  template <typename T> SplatPropertyT<T> *requestSplatProperty( const PropertyHandleT<T> &_handle );
382  template <typename T> CloudPropertyT<T> *requestCloudProperty( const PropertyHandleT<T> &_handle );
383  template <typename T> inline SplatPropertyT<T> *requestSplatProperty( const BasePropertyHandle &_handle ) { return requestSplatProperty( PropertyHandleT<T>( _handle ) ); }
384  template <typename T> inline CloudPropertyT<T> *requestCloudProperty( const BasePropertyHandle &_handle ) { return requestCloudProperty( PropertyHandleT<T>( _handle ) ); }
386 
388 
389  //----------------
390 
392 
405  template <typename T> SplatPropertyT<T> *releaseSplatProperty( const PropertyHandleT<T> &_handle );
407  template <typename T> CloudPropertyT<T> *releaseCloudProperty( const PropertyHandleT<T> &_handle );
408  template <typename T> inline SplatPropertyT<T> *releaseSplatProperty( const BasePropertyHandle &_handle ) { return releaseSplatProperty( PropertyHandleT<T>( _handle ) ); }
409  template <typename T> inline CloudPropertyT<T> *releaseCloudProperty( const BasePropertyHandle &_handle ) { return releaseCloudProperty( PropertyHandleT<T>( _handle ) ); }
411 
413 
414  //----------------
415 
417 
427  template <typename T> SplatPropertyT<T> *getSplatProperty( const PropertyHandleT<T> &_handle );
429  template <typename T> const SplatPropertyT<T> *getSplatProperty( const PropertyHandleT<T> &_handle ) const;
430  template <typename T> CloudPropertyT<T> *getCloudProperty( const PropertyHandleT<T> &_handle );
431  template <typename T> const CloudPropertyT<T> *getCloudProperty( const PropertyHandleT<T> &_handle ) const;
432  template <typename T> inline SplatPropertyT<T> *getSplatProperty( const BasePropertyHandle &_handle ) { return getSplatProperty( PropertyHandleT<T>( _handle ) ); }
433  template <typename T> inline const SplatPropertyT<T> *getSplatProperty( const BasePropertyHandle &_handle ) const { return getSplatProperty( PropertyHandleT<T>( _handle ) ); }
434  template <typename T> inline CloudPropertyT<T> *getCloudProperty( const BasePropertyHandle &_handle ) { return getCloudProperty( PropertyHandleT<T>( _handle ) ); }
435  template <typename T> inline const CloudPropertyT<T> *getCloudProperty( const BasePropertyHandle &_handle ) const { return getCloudProperty( PropertyHandleT<T>( _handle ) ); }
437 
439 
440  //----------------
441 
443 
453  inline const SplatPropertyMap &splatProperties() const { return splatProperties_; }
454 
463  inline const CloudPropertyMap &cloudProperties() const { return cloudProperties_; }
464 
466 
467  //----------------
468 
469 private:
470 
472  void copySplatProperties( const SplatCloud &_splatCloud );
473 
475  void copyCloudProperties( const SplatCloud &_splatCloud );
476 
477  // == MEMBERS =====================================================
478 
479 private:
480 
482  SplatPropertyMap splatProperties_;
483 
485  CloudPropertyMap cloudProperties_;
486 
487  //----------------------------------------------------------------
488 
489 
490 
491  // +---------------------------+
492  // | |
493  // | Predefined Properties |
494  // | |
495  // +---------------------------+
496 
497  // == TYPEDEFS =====================================================
498 
499 public:
500 
502  typedef struct
503  {
506  float x_;
507  float y_;
508  } View;
509 
510  //----------------
511 
513  typedef ACG::Vec3f Position;
515  typedef ACG::Vec3uc Color;
516  typedef ACG::Vec3f Normal;
517  typedef float Pointsize;
518  typedef int Index;
519  typedef std::vector<View> Viewlist;
520  typedef unsigned char Selection; // Do *not* use bool to prevent further trouble because a std::vector<bool>::reference is *not* the same as a reference to bool.
522 
523  //----------------
524 
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;
535 
536  //----------------
537 
538 private:
539 
550 
551  //-- DECLARATIONS ------------------------------------------------
552 
553 public:
554 
556 
566  inline bool requestPositions() { positionsProperty_ = requestSplatProperty( POSITIONS_HANDLE ); return (positionsProperty_ != 0); }
568  inline bool requestColors() { colorsProperty_ = requestSplatProperty( COLORS_HANDLE ); return (colorsProperty_ != 0); }
569  inline bool requestNormals() { normalsProperty_ = requestSplatProperty( NORMALS_HANDLE ); return (normalsProperty_ != 0); }
570  inline bool requestPointsizes() { pointsizesProperty_ = requestSplatProperty( POINTSIZES_HANDLE ); return (pointsizesProperty_ != 0); }
571  inline bool requestIndices() { indicesProperty_ = requestSplatProperty( INDICES_HANDLE ); return (indicesProperty_ != 0); }
572  inline bool requestViewlists() { viewlistsProperty_ = requestSplatProperty( VIEWLISTS_HANDLE ); return (viewlistsProperty_ != 0); }
573  inline bool requestSelections() { selectionsProperty_ = requestSplatProperty( SELECTIONS_HANDLE ); return (selectionsProperty_ != 0); }
575 
577 
578  //----------------
579 
581 
589  inline void releasePositions() { positionsProperty_ = releaseSplatProperty( POSITIONS_HANDLE ); }
591  inline void releaseColors() { colorsProperty_ = releaseSplatProperty( COLORS_HANDLE ); }
592  inline void releaseNormals() { normalsProperty_ = releaseSplatProperty( NORMALS_HANDLE ); }
593  inline void releasePointsizes() { pointsizesProperty_ = releaseSplatProperty( POINTSIZES_HANDLE ); }
594  inline void releaseIndices() { indicesProperty_ = releaseSplatProperty( INDICES_HANDLE ); }
595  inline void releaseViewlists() { viewlistsProperty_ = releaseSplatProperty( VIEWLISTS_HANDLE ); }
596  inline void releaseSelections() { selectionsProperty_ = releaseSplatProperty( SELECTIONS_HANDLE ); }
598 
600 
601  //----------------
602 
604 
612  inline bool hasPositions() const { return (positionsProperty_ != 0); }
614  inline bool hasColors() const { return (colorsProperty_ != 0); }
615  inline bool hasNormals() const { return (normalsProperty_ != 0); }
616  inline bool hasPointsizes() const { return (pointsizesProperty_ != 0); }
617  inline bool hasIndices() const { return (indicesProperty_ != 0); }
618  inline bool hasViewlists() const { return (viewlistsProperty_ != 0); }
619  inline bool hasSelections() const { return (selectionsProperty_ != 0); }
621 
623 
624  //----------------
625 
627 
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 ); }
652 
654 
655  //----------------
656 
657 private:
658 
661  {
662  positionsProperty_ = 0;
663  colorsProperty_ = 0;
664  normalsProperty_ = 0;
665  pointsizesProperty_ = 0;
666  indicesProperty_ = 0;
667  viewlistsProperty_ = 0;
668  selectionsProperty_ = 0;
669  }
670 
673 
676  {
677  positionsProperty_ = getSplatProperty( POSITIONS_HANDLE );
678  colorsProperty_ = getSplatProperty( COLORS_HANDLE );
679  normalsProperty_ = getSplatProperty( NORMALS_HANDLE );
680  pointsizesProperty_ = getSplatProperty( POINTSIZES_HANDLE );
681  indicesProperty_ = getSplatProperty( INDICES_HANDLE );
682  viewlistsProperty_ = getSplatProperty( VIEWLISTS_HANDLE );
683  selectionsProperty_ = getSplatProperty( SELECTIONS_HANDLE );
684  }
685 
688 
691  {
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_ );
699  }
700 
702  inline void swapPredefinedCloudPropertyPointers( SplatCloud &_splatCloud ) { }
703 
704  //-- MEMBERS -----------------------------------------------------
705 
706 private:
707 
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_;
718 
719  //----------------
720 
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;
731 
732  //----------------------------------------------------------------
733 
734 };
735 
736 
737 //================================================================
738 
739 
740 #if defined(INCLUDE_TEMPLATES) && !defined(SPLATCLOUDT_CC)
741 # include "SplatCloudT.cc"
742 #endif
743 
744 
745 //================================================================
746 
747 
748 #endif // SPLATCLOUD_HH
DLLEXPORT DataType typeId(QString _name)
Given a dataType Identifier string this function will return the id of the datatype.
Definition: Types.cc:150
bool requestIndices()
Request the predefined property.
Definition: SplatCloud.hh:571
CloudPropertyMap cloudProperties_
Cloud-property map.
Definition: SplatCloud.hh:485
SplatPropertyMap splatProperties_
Splat-property map.
Definition: SplatCloud.hh:482
Add colors to mesh item (vertices/faces/edges)
Definition: Attributes.hh:88
unsigned int numRequests_
The number of times requestCloudProperty() was called and has not been released yet.
Definition: SplatCloud.hh:270
bool hasPositions() const
Return the availability of the predefined property.
Definition: SplatCloud.hh:613
void swapPredefinedSplatPropertyPointers(SplatCloud &_splatCloud)
Swap pointers to predefined splat-properties.
Definition: SplatCloud.hh:690
void releaseViewlists()
Release the predefined property.
Definition: SplatCloud.hh:595
virtual size_t sizeOf() const
Get the size of type.
Definition: SplatCloud.hh:342
void releaseIndices()
Release the predefined property.
Definition: SplatCloud.hh:594
bool requestViewlists()
Request the predefined property.
Definition: SplatCloud.hh:572
CloudPropertyT< T > * requestCloudProperty(const PropertyHandleT< T > &_handle)
Request a new property.
Definition: SplatCloudT.cc:238
float x_
x-coordinate of pixel position
Definition: SplatCloud.hh:506
SplatPropertyT< T > * requestSplatProperty(const BasePropertyHandle &_handle)
Request a new property.
Definition: SplatCloud.hh:383
T data_
The actual stored data.
Definition: SplatCloud.hh:350
Index & indices(int _idx)
Get a reference of the predefined property's value.
Definition: SplatCloud.hh:645
virtual void clear()
Clear the data vector.
Definition: SplatCloud.hh:316
void clearCloudProperties()
Clear all cloud-properties.
Definition: SplatCloud.cc:172
const Viewlist & viewlists(int _idx) const
Get a reference of the predefined property's value.
Definition: SplatCloud.hh:648
const T & ConstReference
These are used only out of a consistency reason to the class SplatPropertyT.
Definition: SplatCloud.hh:336
Reference data(int _idx)
Access the data as reference.
Definition: SplatCloud.hh:308
virtual ~SplatPropertyInterface()
Destructor.
Definition: SplatCloud.hh:221
bool requestSelections()
Request the predefined property.
Definition: SplatCloud.hh:573
std::map< BasePropertyHandle, SplatPropertyMapEntry > SplatPropertyMap
Definition: SplatCloud.hh:276
SplatPropertyMapEntry(SplatPropertyInterface *_prop, unsigned int _num)
Constructor.
Definition: SplatCloud.hh:254
Pointsize & pointsizes(int _idx)
Get a reference of the predefined property's value.
Definition: SplatCloud.hh:643
Normal & normals(int _idx)
Get a reference of the predefined property's value.
Definition: SplatCloud.hh:641
bool hasNormals() const
Return the availability of the predefined property.
Definition: SplatCloud.hh:615
void releaseNormals()
Release the predefined property.
Definition: SplatCloud.hh:592
const SplatPropertyMap & splatProperties() const
Get all splat-properties.
Definition: SplatCloud.hh:453
virtual CloudPropertyT< T > * clone() const
Return a deep copy of this.
Definition: SplatCloud.hh:346
Color & colors(int _idx)
Get a reference of the predefined property's value.
Definition: SplatCloud.hh:639
void clearSplatProperties()
Clear all splat-properties.
Definition: SplatCloud.cc:154
Selection & selections(int _idx)
Get a reference of the predefined property's value.
Definition: SplatCloud.hh:649
SplatPropertyT< T > * releaseSplatProperty(const PropertyHandleT< T > &_handle)
Release a property.
Definition: SplatCloudT.cc:273
std::string BasePropertyHandle
Definition: SplatCloud.hh:209
const SplatPropertyT< T > * getSplatProperty(const BasePropertyHandle &_handle) const
Get a pointer to a property.
Definition: SplatCloud.hh:433
void copySplatProperties(const SplatCloud &_splatCloud)
Deep copy all splat-properties.
Definition: SplatCloud.cc:80
SplatPropertyT< T > * getSplatProperty(const PropertyHandleT< T > &_handle)
Get a pointer to a property.
Definition: SplatCloudT.cc:351
virtual size_t sizeOf() const
Get the size of type.
Definition: SplatCloud.hh:311
void clear()
Remove all properties and reset the number of splats.
Definition: SplatCloud.cc:190
const Pointsize & pointsizes(int _idx) const
Get a reference of the predefined property's value.
Definition: SplatCloud.hh:644
unsigned int numSplats() const
Get the number of splats.
Definition: SplatCloud.hh:185
void resetPredefinedCloudPropertyPointers()
Reset pointers to predefined cloud-properties.
Definition: SplatCloud.hh:672
bool requestNormals()
Request the predefined property.
Definition: SplatCloud.hh:569
void releaseSelections()
Release the predefined property.
Definition: SplatCloud.hh:596
std::map< BasePropertyHandle, CloudPropertyMapEntry > CloudPropertyMap
Definition: SplatCloud.hh:281
const Color & colors(int _idx) const
Get a reference of the predefined property's value.
Definition: SplatCloud.hh:640
virtual const std::type_info & typeId() const
Get the runtime type information.
Definition: SplatCloud.hh:343
void getPredefinedCloudPropertyPointers()
Get pointers to predefined cloud-properties.
Definition: SplatCloud.hh:687
void getPredefinedSplatPropertyPointers()
Get pointers to predefined splat-properties.
Definition: SplatCloud.hh:675
virtual void resize(unsigned int _num)
Resize the data vector.
Definition: SplatCloud.hh:318
virtual SplatPropertyT< T > * clone() const
Return a deep copy of this.
Definition: SplatCloud.hh:315
void releasePointsizes()
Release the predefined property.
Definition: SplatCloud.hh:593
SplatPropertyT< T > * releaseSplatProperty(const BasePropertyHandle &_handle)
Release a property.
Definition: SplatCloud.hh:408
bool hasViewlists() const
Return the availability of the predefined property.
Definition: SplatCloud.hh:618
CloudPropertyInterface * property_
A valid pointer to a cloud-property.
Definition: SplatCloud.hh:269
CloudPropertyMapEntry(CloudPropertyInterface *_prop, unsigned int _num)
Constructor.
Definition: SplatCloud.hh:267
CloudPropertyT< T > * releaseCloudProperty(const BasePropertyHandle &_handle)
Release a property.
Definition: SplatCloud.hh:409
Position & positions(int _idx)
Get a reference of the predefined property's value.
Definition: SplatCloud.hh:637
T & Reference
These are references to T, not to CloudPropertyT.
Definition: SplatCloud.hh:335
int featureIdx_
SIFT-feature index.
Definition: SplatCloud.hh:505
void resetPredefinedSplatPropertyPointers()
Reset pointers to predefined splat-properties.
Definition: SplatCloud.hh:660
SplatCloud()
Standard constructor.
Definition: SplatCloud.hh:93
bool hasPointsizes() const
Return the availability of the predefined property.
Definition: SplatCloud.hh:616
virtual void pushback()
Add one element at the end of the data vector.
Definition: SplatCloud.hh:317
CloudPropertyMapEntry()
Standard constructor.
Definition: SplatCloud.hh:266
const CloudPropertyT< T > * getCloudProperty(const BasePropertyHandle &_handle) const
Get a pointer to a property.
Definition: SplatCloud.hh:435
Reference data()
Access the data as reference.
Definition: SplatCloud.hh:339
bool requestPositions()
Request the predefined property.
Definition: SplatCloud.hh:567
CloudPropertyT< T > * releaseCloudProperty(const PropertyHandleT< T > &_handle)
Release a property.
Definition: SplatCloudT.cc:312
void copyCloudProperties(const SplatCloud &_splatCloud)
Deep copy all cloud-properties.
Definition: SplatCloud.cc:110
CloudPropertyT< T > * getCloudProperty(const BasePropertyHandle &_handle)
Get a pointer to a property.
Definition: SplatCloud.hh:434
unsigned int numRequests_
The number of times requestSplatProperty() was called and has not been released yet.
Definition: SplatCloud.hh:257
void swap(SplatCloud &_splatCloud)
Swap the content.
Definition: SplatCloud.cc:204
SplatPropertyT< T > * getSplatProperty(const BasePropertyHandle &_handle)
Get a pointer to a property.
Definition: SplatCloud.hh:432
virtual ~CloudPropertyInterface()
Destructor.
Definition: SplatCloud.hh:241
const Selection & selections(int _idx) const
Get a reference of the predefined property's value.
Definition: SplatCloud.hh:650
#define DLLEXPORT
const Normal & normals(int _idx) const
Get a reference of the predefined property's value.
Definition: SplatCloud.hh:642
SplatCloud & operator=(const SplatCloud &_splatCloud)
Assign operator.
Definition: SplatCloud.hh:106
SplatPropertyInterface * property_
A valid pointer to a splat-property.
Definition: SplatCloud.hh:256
bool requestPointsizes()
Request the predefined property.
Definition: SplatCloud.hh:570
SplatPropertyMapEntry()
Standard constructor.
Definition: SplatCloud.hh:253
Add normals to mesh item (vertices/faces)
Definition: Attributes.hh:87
ConstReference data() const
Access the data as const reference.
Definition: SplatCloud.hh:340
ConstReference data(int _idx) const
Access the data as const reference.
Definition: SplatCloud.hh:309
CloudPropertyT< T > * requestCloudProperty(const BasePropertyHandle &_handle)
Request a new property.
Definition: SplatCloud.hh:384
Viewlist & viewlists(int _idx)
Get a reference of the predefined property's value.
Definition: SplatCloud.hh:647
void swapPredefinedCloudPropertyPointers(SplatCloud &_splatCloud)
Swap pointers to predefined cloud-properties.
Definition: SplatCloud.hh:702
const Index & indices(int _idx) const
Get a reference of the predefined property's value.
Definition: SplatCloud.hh:646
~SplatCloud()
Destructor.
Definition: SplatCloud.hh:103
std::vector< T >::const_reference ConstReference
These are used because a std::vector::reference is not the same as a reference to bool...
Definition: SplatCloud.hh:305
bool requestColors()
Request the predefined property.
Definition: SplatCloud.hh:568
std::vector< T > data_
The actual stored data (one element per splat)
Definition: SplatCloud.hh:323
CloudPropertyT< T > * getCloudProperty(const PropertyHandleT< T > &_handle)
Get a pointer to a property.
Definition: SplatCloudT.cc:379
float y_
y-coordinate of pixel position
Definition: SplatCloud.hh:507
const CloudPropertyMap & cloudProperties() const
Get all cloud-properties.
Definition: SplatCloud.hh:463
virtual const std::type_info & typeId() const
Get the runtime type information.
Definition: SplatCloud.hh:312
bool hasColors() const
Return the availability of the predefined property.
Definition: SplatCloud.hh:614
The property handle, use it to access the properties.
Definition: Properties.hh:75
bool hasSelections() const
Return the availability of the predefined property.
Definition: SplatCloud.hh:619
unsigned int numSplats_
Number of splats.
Definition: SplatCloud.hh:192
SplatPropertyT< T > * requestSplatProperty(const PropertyHandleT< T > &_handle)
Request a new property.
Definition: SplatCloudT.cc:196
bool hasIndices() const
Return the availability of the predefined property.
Definition: SplatCloud.hh:617
const Position & positions(int _idx) const
Get a reference of the predefined property's value.
Definition: SplatCloud.hh:638
void releasePositions()
Release the predefined property.
Definition: SplatCloud.hh:590
int cameraObjectId_
Camera-object id.
Definition: SplatCloud.hh:504
std::vector< T >::reference Reference
These are references to T, not to SplatPropertyT.
Definition: SplatCloud.hh:304
void releaseColors()
Release the predefined property.
Definition: SplatCloud.hh:591