Developer Documentation

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 //================================================================
45 //
46 // CLASS SplatCloud
47 //
48 // SplatCloud stores the actual data for a SplatCloud.
49 //
50 //================================================================
51
52
53 #ifndef SPLATCLOUD_HH
54 #define SPLATCLOUD_HH
55
56
57 //== INCLUDES ====================================================
58
59
60 #include <OpenFlipper/common/ObjectTypeDLLDefines.hh>
61
62 #include <typeinfo>
63 #include <string>
64 #include <map>
65 #include <vector>
66 #include <algorithm>
67
68 #include <ACG/Math/VectorT.hh>
69
70
71 //== CLASS DEFINITION ============================================
72
73
79 class OBJECTTYPEDLLEXPORT SplatCloud
80 {
81
82 // == DECLARATIONS =====================================================
83
84 public:
85
87 inline SplatCloud() : numSplats_( 0 )
88 {
89 resetPredefinedSplatPropertyPointers();
90 resetPredefinedCloudPropertyPointers();
91 }
92
94 SplatCloud( const SplatCloud &_splatCloud );
95
97 inline ~SplatCloud() { clear(); }
98
100 inline SplatCloud &operator=( const SplatCloud &_splatCloud ) { SplatCloud temp( _splatCloud ); swap( temp ); return *this; }
101
103 void clear();
104
106 void swap( SplatCloud &_splatCloud );
107
108 //----------------
109
114 void clearSplats();
115
116 //----------------
117
122 void pushbackSplat();
123
124 //----------------
125
132 void resizeSplats( unsigned int _num );
133
134 //----------------
135
145 template <typename T> unsigned int eraseSplatsByIndex( const T &_indices );
146
147 //----------------
148
159 template <typename T> unsigned int eraseSplatsByFlag( const std::vector<T> &_flags );
160
161 //----------------
162
171 template <typename T> void cropSplats( const T &_indices );
172
173 //----------------
174
179 inline unsigned int numSplats() const { return numSplats_; }
180
181 // == MEMBERS =====================================================
182
183 private:
184
186 unsigned int numSplats_;
187
188 //----------------------------------------------------------------
189
190
191
192 // +------------------------+
193 // | |
194 // | General Properties |
195 // | |
196 // +------------------------+
197
198 // == TYPEDEFS =====================================================
199
200 public:
201
203 typedef std::string BasePropertyHandle;
204
205 //----------------
206
208 class SplatPropertyInterface
209 {
210 friend class SplatCloud;
211 public:
212 virtual size_t sizeOf() const = 0;
213 virtual const std::type_info &typeId() const = 0;
214 private:
215 virtual inline ~SplatPropertyInterface() { }
216 virtual SplatPropertyInterface *clone() 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;
221 private:
222 void operator=( const SplatPropertyInterface & );
223 };
224
225 //----------------
226
228 class CloudPropertyInterface
229 {
230 friend class SplatCloud;
231 public:
232 virtual size_t sizeOf() const = 0;
233 virtual const std::type_info &typeId() const = 0;
234 private:
235 virtual inline ~CloudPropertyInterface() { }
236 virtual CloudPropertyInterface *clone() const = 0;
237 private:
238 void operator=( const CloudPropertyInterface & );
239 };
240
241 //----------------
242
244 class SplatPropertyMapEntry
245 {
246 public:
247 SplatPropertyMapEntry() : property_( 0 ), numRequests_( 0 ) { }
248 SplatPropertyMapEntry( SplatPropertyInterface *_prop, unsigned int _num ) : property_( _prop ), numRequests_( _num ) { }
249 public:
250 SplatPropertyInterface *property_;
251 unsigned int numRequests_;
252 };
253
254 //----------------
255
257 class CloudPropertyMapEntry
258 {
259 public:
260 CloudPropertyMapEntry() : property_( 0 ), numRequests_( 0 ) { }
261 CloudPropertyMapEntry( CloudPropertyInterface *_prop, unsigned int _num ) : property_( _prop ), numRequests_( _num ) { }
262 public:
263 CloudPropertyInterface *property_;
264 unsigned int numRequests_;
265 };
266
267 //----------------
268
270 typedef std::map<BasePropertyHandle, SplatPropertyMapEntry> SplatPropertyMap;
271
272 //----------------
273
275 typedef std::map<BasePropertyHandle, CloudPropertyMapEntry> CloudPropertyMap;
276
277 //----------------
278
279 public:
280
282 template <typename T>
283 class PropertyHandleT : public BasePropertyHandle
284 {
285 public:
286 explicit inline PropertyHandleT<T>( const BasePropertyHandle &_handle ) : BasePropertyHandle( _handle ) { }
287 };
288
289 //----------------
290
292 template <typename T>
293 class SplatPropertyT : public SplatPropertyInterface
294 {
295 friend class SplatCloud;
296 public:
297 typedef T Value;
298 typedef typename std::vector<T>:: reference Reference;
299 typedef typename std::vector<T>::const_reference ConstReference;
300 public:
301 explicit inline SplatPropertyT<T>( const PropertyHandleT<T> &_handle, unsigned int _num ) : data_( _num ) { }
302 inline Reference data( int _idx ) { return data_[ _idx ]; }
303 inline ConstReference data( int _idx ) const { return data_[ _idx ]; }
304 public:
305 virtual inline size_t sizeOf() const { return sizeof( T ); }
306 virtual inline const std::type_info &typeId() const { return typeid( T ); }
307 private:
308 virtual inline ~SplatPropertyT<T>() { }
309 virtual inline SplatPropertyT<T> *clone() const { return new SplatPropertyT<T>( *this ); }
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 );
314 private:
315 void operator=( const SplatPropertyT<T> & );
316 private:
317 std::vector<T> data_;
318 };
319
320 //----------------
321
323 template <typename T>
324 class CloudPropertyT : public CloudPropertyInterface
325 {
326 friend class SplatCloud;
327 public:
328 typedef T Value;
329 typedef T & Reference;
330 typedef const T & ConstReference;
331 public:
332 explicit inline CloudPropertyT<T>( const PropertyHandleT<T> &_handle ) { }
333 inline Reference data() { return data_; }
334 inline ConstReference data() const { return data_; }
335 public:
336 virtual inline size_t sizeOf() const { return sizeof( T ); }
337 virtual inline const std::type_info &typeId() const { return typeid( T ); }
338 private:
339 virtual inline ~CloudPropertyT<T>() { }
340 virtual inline CloudPropertyT<T> *clone() const { return new CloudPropertyT<T>( *this ); }
341 private:
342 void operator=( const CloudPropertyT<T> & );
343 private:
344 T data_;
345 };
346
347 //-- DECLARATIONS ------------------------------------------------
348
349 public:
350
352 void clearSplatProperties();
353
355 void clearCloudProperties();
356
357 //----------------
358
360
374 template <typename T> SplatPropertyT<T> *requestSplatProperty( const PropertyHandleT<T> &_handle );
376 template <typename T> CloudPropertyT<T> *requestCloudProperty( const PropertyHandleT<T> &_handle );
377 template <typename T> inline SplatPropertyT<T> *requestSplatProperty( const BasePropertyHandle &_handle ) { return requestSplatProperty( PropertyHandleT<T>( _handle ) ); }
378 template <typename T> inline CloudPropertyT<T> *requestCloudProperty( const BasePropertyHandle &_handle ) { return requestCloudProperty( PropertyHandleT<T>( _handle ) ); }
380
382
383 //----------------
384
386
399 template <typename T> SplatPropertyT<T> *releaseSplatProperty( const PropertyHandleT<T> &_handle );
401 template <typename T> CloudPropertyT<T> *releaseCloudProperty( const PropertyHandleT<T> &_handle );
402 template <typename T> inline SplatPropertyT<T> *releaseSplatProperty( const BasePropertyHandle &_handle ) { return releaseSplatProperty( PropertyHandleT<T>( _handle ) ); }
403 template <typename T> inline CloudPropertyT<T> *releaseCloudProperty( const BasePropertyHandle &_handle ) { return releaseCloudProperty( PropertyHandleT<T>( _handle ) ); }
405
407
408 //----------------
409
411
421 template <typename T> SplatPropertyT<T> *getSplatProperty( const PropertyHandleT<T> &_handle );
423 template <typename T> const SplatPropertyT<T> *getSplatProperty( const PropertyHandleT<T> &_handle ) const;
424 template <typename T> CloudPropertyT<T> *getCloudProperty( const PropertyHandleT<T> &_handle );
425 template <typename T> const CloudPropertyT<T> *getCloudProperty( const PropertyHandleT<T> &_handle ) const;
426 template <typename T> inline SplatPropertyT<T> *getSplatProperty( const BasePropertyHandle &_handle ) { return getSplatProperty( PropertyHandleT<T>( _handle ) ); }
427 template <typename T> inline const SplatPropertyT<T> *getSplatProperty( const BasePropertyHandle &_handle ) const { return getSplatProperty( PropertyHandleT<T>( _handle ) ); }
428 template <typename T> inline CloudPropertyT<T> *getCloudProperty( const BasePropertyHandle &_handle ) { return getCloudProperty( PropertyHandleT<T>( _handle ) ); }
429 template <typename T> inline const CloudPropertyT<T> *getCloudProperty( const BasePropertyHandle &_handle ) const { return getCloudProperty( PropertyHandleT<T>( _handle ) ); }
431
433
434 //----------------
435
437
447 inline const SplatPropertyMap &splatProperties() const { return splatProperties_; }
448
457 inline const CloudPropertyMap &cloudProperties() const { return cloudProperties_; }
458
460
461 //----------------
462
463 private:
464
466 void copySplatProperties( const SplatCloud &_splatCloud );
467
469 void copyCloudProperties( const SplatCloud &_splatCloud );
470
471 // == MEMBERS =====================================================
472
473 private:
474
476 SplatPropertyMap splatProperties_;
477
479 CloudPropertyMap cloudProperties_;
480
481 //----------------------------------------------------------------
482
483
484
485 // +---------------------------+
486 // | |
487 // | Predefined Properties |
488 // | |
489 // +---------------------------+
490
491 // == TYPEDEFS =====================================================
492
493 public:
494
496 typedef struct
497 {
498 int cameraObjectId_;
499 int featureIdx_;
500 float x_;
501 float y_;
502 } View;
503
504 //----------------
505
507 typedef ACG::Vec3f Position;
509 typedef ACG::Vec3uc Color;
510 typedef ACG::Vec3f Normal;
511 typedef float Pointsize;
512 typedef int Index;
513 typedef std::vector<View> Viewlist;
514 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.
516
517 //----------------
518
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;
529
530 //----------------
531
532 private:
533
535 typedef PropertyHandleT<Position > PositionsHandle;
537 typedef PropertyHandleT<Color > ColorsHandle;
538 typedef PropertyHandleT<Normal > NormalsHandle;
539 typedef PropertyHandleT<Pointsize> PointsizesHandle;
540 typedef PropertyHandleT<Index > IndicesHandle;
541 typedef PropertyHandleT<Viewlist > ViewlistsHandle;
542 typedef PropertyHandleT<Selection> SelectionsHandle;
544
545 //-- DECLARATIONS ------------------------------------------------
546
547 public:
548
550
560 inline bool requestPositions() { positionsProperty_ = requestSplatProperty( POSITIONS_HANDLE ); return (positionsProperty_ != 0); }
562 inline bool requestColors() { colorsProperty_ = requestSplatProperty( COLORS_HANDLE ); return (colorsProperty_ != 0); }
563 inline bool requestNormals() { normalsProperty_ = requestSplatProperty( NORMALS_HANDLE ); return (normalsProperty_ != 0); }
564 inline bool requestPointsizes() { pointsizesProperty_ = requestSplatProperty( POINTSIZES_HANDLE ); return (pointsizesProperty_ != 0); }
565 inline bool requestIndices() { indicesProperty_ = requestSplatProperty( INDICES_HANDLE ); return (indicesProperty_ != 0); }
566 inline bool requestViewlists() { viewlistsProperty_ = requestSplatProperty( VIEWLISTS_HANDLE ); return (viewlistsProperty_ != 0); }
567 inline bool requestSelections() { selectionsProperty_ = requestSplatProperty( SELECTIONS_HANDLE ); return (selectionsProperty_ != 0); }
569
571
572 //----------------
573
575
583 inline void releasePositions() { positionsProperty_ = releaseSplatProperty( POSITIONS_HANDLE ); }
585 inline void releaseColors() { colorsProperty_ = releaseSplatProperty( COLORS_HANDLE ); }
586 inline void releaseNormals() { normalsProperty_ = releaseSplatProperty( NORMALS_HANDLE ); }
587 inline void releasePointsizes() { pointsizesProperty_ = releaseSplatProperty( POINTSIZES_HANDLE ); }
588 inline void releaseIndices() { indicesProperty_ = releaseSplatProperty( INDICES_HANDLE ); }
589 inline void releaseViewlists() { viewlistsProperty_ = releaseSplatProperty( VIEWLISTS_HANDLE ); }
590 inline void releaseSelections() { selectionsProperty_ = releaseSplatProperty( SELECTIONS_HANDLE ); }
592
594
595 //----------------
596
598
606 inline bool hasPositions() const { return (positionsProperty_ != 0); }
608 inline bool hasColors() const { return (colorsProperty_ != 0); }
609 inline bool hasNormals() const { return (normalsProperty_ != 0); }
610 inline bool hasPointsizes() const { return (pointsizesProperty_ != 0); }
611 inline bool hasIndices() const { return (indicesProperty_ != 0); }
612 inline bool hasViewlists() const { return (viewlistsProperty_ != 0); }
613 inline bool hasSelections() const { return (selectionsProperty_ != 0); }
615
617
618 //----------------
619
621
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 ); }
646
648
649 //----------------
650
651 private:
652
654 inline void resetPredefinedSplatPropertyPointers()
655 {
656 positionsProperty_ = 0;
657 colorsProperty_ = 0;
658 normalsProperty_ = 0;
659 pointsizesProperty_ = 0;
660 indicesProperty_ = 0;
661 viewlistsProperty_ = 0;
662 selectionsProperty_ = 0;
663 }
664
666 inline void resetPredefinedCloudPropertyPointers() { }
667
669 inline void getPredefinedSplatPropertyPointers()
670 {
671 positionsProperty_ = getSplatProperty( POSITIONS_HANDLE );
672 colorsProperty_ = getSplatProperty( COLORS_HANDLE );
673 normalsProperty_ = getSplatProperty( NORMALS_HANDLE );
674 pointsizesProperty_ = getSplatProperty( POINTSIZES_HANDLE );
675 indicesProperty_ = getSplatProperty( INDICES_HANDLE );
676 viewlistsProperty_ = getSplatProperty( VIEWLISTS_HANDLE );
677 selectionsProperty_ = getSplatProperty( SELECTIONS_HANDLE );
678 }
679
681 inline void getPredefinedCloudPropertyPointers() { }
682
684 inline void swapPredefinedSplatPropertyPointers( SplatCloud &_splatCloud )
685 {
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_ );
693 }
694
696 inline void swapPredefinedCloudPropertyPointers( SplatCloud &_splatCloud ) { }
697
698 //-- MEMBERS -----------------------------------------------------
699
700 private:
701
703 SplatPropertyT<Position> *positionsProperty_;
705 SplatPropertyT<Color> *colorsProperty_;
706 SplatPropertyT<Normal> *normalsProperty_;
707 SplatPropertyT<Pointsize> *pointsizesProperty_;
708 SplatPropertyT<Index> *indicesProperty_;
709 SplatPropertyT<Viewlist> *viewlistsProperty_;
710 SplatPropertyT<Selection> *selectionsProperty_;
712
713 //----------------
714
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;
725
726 //----------------------------------------------------------------
727
728 };
729
730
731 //================================================================
732
733
734 #if defined(INCLUDE_TEMPLATES) && !defined(SPLATCLOUDT_CC)
735 # include "SplatCloudT_impl.hh"
736 #endif
737
738
739 //================================================================
740
741
742 #endif // SPLATCLOUD_HH
SplatCloud::swapPredefinedCloudPropertyPointers
void swapPredefinedCloudPropertyPointers(SplatCloud &_splatCloud)
Swap pointers to predefined cloud-properties.
Definition: SplatCloud.hh:696
SplatCloud::getPredefinedCloudPropertyPointers
void getPredefinedCloudPropertyPointers()
Get pointers to predefined cloud-properties.
Definition: SplatCloud.hh:681
SplatCloud::CloudPropertyMapEntry
Definition: SplatCloud.hh:257
SplatCloud::requestSelections
bool requestSelections()
Request the predefined property.
Definition: SplatCloud.hh:567
SplatCloud::getCloudProperty
CloudPropertyT< T > * getCloudProperty(const PropertyHandleT< T > &_handle)
Get a pointer to a property.
Definition: SplatCloudT_impl.hh:373
SplatCloud::SplatPropertyInterface
Definition: SplatCloud.hh:208
SplatCloud::copyCloudProperties
void copyCloudProperties(const SplatCloud &_splatCloud)
Deep copy all cloud-properties.
Definition: SplatCloud.cc:104
SplatCloud::CloudPropertyMapEntry::CloudPropertyMapEntry
CloudPropertyMapEntry(CloudPropertyInterface *_prop, unsigned int _num)
Constructor.
Definition: SplatCloud.hh:261
SplatCloud::CloudPropertyT::clone
virtual CloudPropertyT< T > * clone() const
Return a deep copy of this.
Definition: SplatCloud.hh:340
SplatCloud::releasePositions
void releasePositions()
Release the predefined property.
Definition: SplatCloud.hh:584
SplatCloud::releaseSelections
void releaseSelections()
Release the predefined property.
Definition: SplatCloud.hh:590
SplatCloud::selections
Selection & selections(int _idx)
Get a reference of the predefined property&#39;s value.
Definition: SplatCloud.hh:643
SplatCloud::CloudPropertyT::Value
T Value
Value type.
Definition: SplatCloud.hh:328
SplatCloud::getSplatProperty
const SplatPropertyT< T > * getSplatProperty(const BasePropertyHandle &_handle) const
Get a pointer to a property.
Definition: SplatCloud.hh:427
SplatCloud::requestViewlists
bool requestViewlists()
Request the predefined property.
Definition: SplatCloud.hh:566
SplatCloud::SplatPropertyT::ConstReference
std::vector< T >::const_reference ConstReference
These are used because a std::vector<bool>::reference is not the same as a reference to bool...
Definition: SplatCloud.hh:299
SplatCloud::hasNormals
bool hasNormals() const
Return the availability of the predefined property.
Definition: SplatCloud.hh:609
SplatCloud::SplatPropertyMapEntry::SplatPropertyMapEntry
SplatPropertyMapEntry(SplatPropertyInterface *_prop, unsigned int _num)
Constructor.
Definition: SplatCloud.hh:248
SplatCloud::SplatCloud
SplatCloud()
Standard constructor.
Definition: SplatCloud.hh:87
SplatCloud::SplatPropertyT::data
Reference data(int _idx)
Access the data as reference.
Definition: SplatCloud.hh:302
SplatCloud::View::cameraObjectId_
int cameraObjectId_
Camera-object id.
Definition: SplatCloud.hh:498
ObjectTypeDLLDefines.hh
SplatCloud::SplatPropertyT::clear
virtual void clear()
Clear the data vector.
Definition: SplatCloud.hh:310
SplatCloud::requestCloudProperty
CloudPropertyT< T > * requestCloudProperty(const PropertyHandleT< T > &_handle)
Request a new property.
Definition: SplatCloudT_impl.hh:232
SplatCloud::CloudPropertyMapEntry::CloudPropertyMapEntry
CloudPropertyMapEntry()
Standard constructor.
Definition: SplatCloud.hh:260
SplatCloud::SplatPropertyT::typeId
virtual const std::type_info & typeId() const
Get the runtime type information.
Definition: SplatCloud.hh:306
SplatCloud::SplatPropertyMapEntry::numRequests_
unsigned int numRequests_
The number of times requestSplatProperty() was called and has not been released yet.
Definition: SplatCloud.hh:251
SplatCloud::requestIndices
bool requestIndices()
Request the predefined property.
Definition: SplatCloud.hh:565
SplatCloud::requestCloudProperty
CloudPropertyT< T > * requestCloudProperty(const BasePropertyHandle &_handle)
Request a new property.
Definition: SplatCloud.hh:378
SplatCloud::CloudPropertyMapEntry::property_
CloudPropertyInterface * property_
A valid pointer to a cloud-property.
Definition: SplatCloud.hh:263
SplatCloud::View::y_
float y_
y-coordinate of pixel position
Definition: SplatCloud.hh:501
SplatCloud::releaseColors
void releaseColors()
Release the predefined property.
Definition: SplatCloud.hh:585
SplatCloud::View
Definition: SplatCloud.hh:496
SplatCloud::normals
const Normal & normals(int _idx) const
Get a reference of the predefined property&#39;s value.
Definition: SplatCloud.hh:636
SplatCloud::PropertyHandleT
Definition: SplatCloud.hh:283
SplatCloud::swap
void swap(SplatCloud &_splatCloud)
Swap the content.
Definition: SplatCloud.cc:198
SplatCloud::CloudPropertyT::data
ConstReference data() const
Access the data as const reference.
Definition: SplatCloud.hh:334
SplatCloud::colors
Color & colors(int _idx)
Get a reference of the predefined property&#39;s value.
Definition: SplatCloud.hh:633
SplatCloud::hasColors
bool hasColors() const
Return the availability of the predefined property.
Definition: SplatCloud.hh:608
SplatCloud::SplatPropertyT::data
ConstReference data(int _idx) const
Access the data as const reference.
Definition: SplatCloud.hh:303
SplatCloud::clearSplatProperties
void clearSplatProperties()
Clear all splat-properties.
Definition: SplatCloud.cc:148
SplatCloud::hasPositions
bool hasPositions() const
Return the availability of the predefined property.
Definition: SplatCloud.hh:607
SplatCloud::requestSplatProperty
SplatPropertyT< T > * requestSplatProperty(const BasePropertyHandle &_handle)
Request a new property.
Definition: SplatCloud.hh:377
SplatCloud::normals
Normal & normals(int _idx)
Get a reference of the predefined property&#39;s value.
Definition: SplatCloud.hh:635
SplatCloud::operator=
SplatCloud & operator=(const SplatCloud &_splatCloud)
Assign operator.
Definition: SplatCloud.hh:100
SplatCloud::CloudPropertyT::data_
T data_
The actual stored data.
Definition: SplatCloud.hh:344
OpenMesh::Attributes::Color
Add colors to mesh item (vertices/faces/edges)
Definition: Attributes.hh:83
SplatCloud::SplatPropertyMapEntry::SplatPropertyMapEntry
SplatPropertyMapEntry()
Standard constructor.
Definition: SplatCloud.hh:247
SplatCloud::requestPositions
bool requestPositions()
Request the predefined property.
Definition: SplatCloud.hh:561
SplatCloud::SplatPropertyT::pushback
virtual void pushback()
Add one element at the end of the data vector.
Definition: SplatCloud.hh:311
SplatCloud::releaseViewlists
void releaseViewlists()
Release the predefined property.
Definition: SplatCloud.hh:589
SplatCloud::CloudPropertyT::ConstReference
const T & ConstReference
These are used only out of a consistency reason to the class SplatPropertyT<T>.
Definition: SplatCloud.hh:330
SplatCloud::positions
Position & positions(int _idx)
Get a reference of the predefined property&#39;s value.
Definition: SplatCloud.hh:631
SplatCloud::releaseNormals
void releaseNormals()
Release the predefined property.
Definition: SplatCloud.hh:586
SplatCloud::splatProperties
const SplatPropertyMap & splatProperties() const
Get all splat-properties.
Definition: SplatCloud.hh:447
SplatCloud::copySplatProperties
void copySplatProperties(const SplatCloud &_splatCloud)
Deep copy all splat-properties.
Definition: SplatCloud.cc:74
SplatCloud::CloudPropertyT::sizeOf
virtual size_t sizeOf() const
Get the size of type.
Definition: SplatCloud.hh:336
SplatCloud::cloudProperties_
CloudPropertyMap cloudProperties_
Cloud-property map.
Definition: SplatCloud.hh:479
SplatCloud::indices
Index & indices(int _idx)
Get a reference of the predefined property&#39;s value.
Definition: SplatCloud.hh:639
SplatCloud::CloudPropertyT
Definition: SplatCloud.hh:324
SplatCloud::getSplatProperty
SplatPropertyT< T > * getSplatProperty(const BasePropertyHandle &_handle)
Get a pointer to a property.
Definition: SplatCloud.hh:426
SplatCloud::releaseIndices
void releaseIndices()
Release the predefined property.
Definition: SplatCloud.hh:588
SplatCloud::numSplats
unsigned int numSplats() const
Get the number of splats.
Definition: SplatCloud.hh:179
SplatCloud::CloudPropertyMapEntry::numRequests_
unsigned int numRequests_
The number of times requestCloudProperty() was called and has not been released yet.
Definition: SplatCloud.hh:264
SplatCloud::SplatPropertyT::sizeOf
virtual size_t sizeOf() const
Get the size of type.
Definition: SplatCloud.hh:305
SplatCloud::SplatPropertyT::Reference
std::vector< T >::reference Reference
These are references to T, not to SplatPropertyT<T>.
Definition: SplatCloud.hh:298
SplatCloud::colors
const Color & colors(int _idx) const
Get a reference of the predefined property&#39;s value.
Definition: SplatCloud.hh:634
SplatCloud::positions
const Position & positions(int _idx) const
Get a reference of the predefined property&#39;s value.
Definition: SplatCloud.hh:632
SplatCloud::SplatPropertyMapEntry::property_
SplatPropertyInterface * property_
A valid pointer to a splat-property.
Definition: SplatCloud.hh:250
SplatCloud::indices
const Index & indices(int _idx) const
Get a reference of the predefined property&#39;s value.
Definition: SplatCloud.hh:640
SplatCloud::SplatPropertyMapEntry
Definition: SplatCloud.hh:244
SplatCloud::selections
const Selection & selections(int _idx) const
Get a reference of the predefined property&#39;s value.
Definition: SplatCloud.hh:644
SplatCloud::hasIndices
bool hasIndices() const
Return the availability of the predefined property.
Definition: SplatCloud.hh:611
SplatCloud::SplatPropertyT::Value
T Value
Value type.
Definition: SplatCloud.hh:297
SplatCloud::~SplatCloud
~SplatCloud()
Destructor.
Definition: SplatCloud.hh:97
SplatCloud::getCloudProperty
const CloudPropertyT< T > * getCloudProperty(const BasePropertyHandle &_handle) const
Get a pointer to a property.
Definition: SplatCloud.hh:429
SplatCloud::BasePropertyHandle
std::string BasePropertyHandle
Definition: SplatCloud.hh:203
SplatCloud
Definition: SplatCloud.hh:79
SplatCloud::View::x_
float x_
x-coordinate of pixel position
Definition: SplatCloud.hh:500
SplatCloud::resetPredefinedSplatPropertyPointers
void resetPredefinedSplatPropertyPointers()
Reset pointers to predefined splat-properties.
Definition: SplatCloud.hh:654
SplatCloud::clearCloudProperties
void clearCloudProperties()
Clear all cloud-properties.
Definition: SplatCloud.cc:166
SplatCloud::SplatPropertyT
Definition: SplatCloud.hh:293
SplatCloud::clear
void clear()
Remove all properties and reset the number of splats.
Definition: SplatCloud.cc:184
SplatCloud::pointsizes
const Pointsize & pointsizes(int _idx) const
Get a reference of the predefined property&#39;s value.
Definition: SplatCloud.hh:638
SplatCloud::releaseCloudProperty
CloudPropertyT< T > * releaseCloudProperty(const BasePropertyHandle &_handle)
Release a property.
Definition: SplatCloud.hh:403
SplatCloud::releaseSplatProperty
SplatPropertyT< T > * releaseSplatProperty(const PropertyHandleT< T > &_handle)
Release a property.
Definition: SplatCloudT_impl.hh:267
SplatCloud::cloudProperties
const CloudPropertyMap & cloudProperties() const
Get all cloud-properties.
Definition: SplatCloud.hh:457
SplatCloud::SplatPropertyT::resize
virtual void resize(unsigned int _num)
Resize the data vector.
Definition: SplatCloud.hh:312
SplatCloud::CloudPropertyT::typeId
virtual const std::type_info & typeId() const
Get the runtime type information.
Definition: SplatCloud.hh:337
SplatCloud::numSplats_
unsigned int numSplats_
Number of splats.
Definition: SplatCloud.hh:186
SplatCloud::requestSplatProperty
SplatPropertyT< T > * requestSplatProperty(const PropertyHandleT< T > &_handle)
Request a new property.
Definition: SplatCloudT_impl.hh:190
SplatCloud::releaseCloudProperty
CloudPropertyT< T > * releaseCloudProperty(const PropertyHandleT< T > &_handle)
Release a property.
Definition: SplatCloudT_impl.hh:306
SplatCloud::hasSelections
bool hasSelections() const
Return the availability of the predefined property.
Definition: SplatCloud.hh:613
SplatCloud::requestNormals
bool requestNormals()
Request the predefined property.
Definition: SplatCloud.hh:563
SplatCloud::requestColors
bool requestColors()
Request the predefined property.
Definition: SplatCloud.hh:562
SplatCloud::CloudPropertyT::data
Reference data()
Access the data as reference.
Definition: SplatCloud.hh:333
SplatCloud::SplatPropertyT::clone
virtual SplatPropertyT< T > * clone() const
Return a deep copy of this.
Definition: SplatCloud.hh:309
SplatCloud::SplatPropertyT::data_
std::vector< T > data_
The actual stored data (one element per splat)
Definition: SplatCloud.hh:317
OpenMesh::VectorT
Definition: Vector11T.hh:83
SplatCloud::getCloudProperty
CloudPropertyT< T > * getCloudProperty(const BasePropertyHandle &_handle)
Get a pointer to a property.
Definition: SplatCloud.hh:428
SplatCloud::hasViewlists
bool hasViewlists() const
Return the availability of the predefined property.
Definition: SplatCloud.hh:612
SplatCloud::releaseSplatProperty
SplatPropertyT< T > * releaseSplatProperty(const BasePropertyHandle &_handle)
Release a property.
Definition: SplatCloud.hh:402
SplatCloud::getPredefinedSplatPropertyPointers
void getPredefinedSplatPropertyPointers()
Get pointers to predefined splat-properties.
Definition: SplatCloud.hh:669
SplatCloud::CloudPropertyT::Reference
T & Reference
These are references to T, not to CloudPropertyT<T>.
Definition: SplatCloud.hh:329
SplatCloud::swapPredefinedSplatPropertyPointers
void swapPredefinedSplatPropertyPointers(SplatCloud &_splatCloud)
Swap pointers to predefined splat-properties.
Definition: SplatCloud.hh:684
SplatCloud::SplatPropertyInterface::~SplatPropertyInterface
virtual ~SplatPropertyInterface()
Destructor.
Definition: SplatCloud.hh:215
SplatCloud::viewlists
const Viewlist & viewlists(int _idx) const
Get a reference of the predefined property&#39;s value.
Definition: SplatCloud.hh:642
SplatCloud::releasePointsizes
void releasePointsizes()
Release the predefined property.
Definition: SplatCloud.hh:587
SplatCloud::SplatPropertyMap
std::map< BasePropertyHandle, SplatPropertyMapEntry > SplatPropertyMap
Definition: SplatCloud.hh:270
SplatCloud::hasPointsizes
bool hasPointsizes() const
Return the availability of the predefined property.
Definition: SplatCloud.hh:610
SplatCloud::CloudPropertyInterface
Definition: SplatCloud.hh:228
SplatCloud::resetPredefinedCloudPropertyPointers
void resetPredefinedCloudPropertyPointers()
Reset pointers to predefined cloud-properties.
Definition: SplatCloud.hh:666
SplatCloud::CloudPropertyMap
std::map< BasePropertyHandle, CloudPropertyMapEntry > CloudPropertyMap
Definition: SplatCloud.hh:275
SplatCloud::splatProperties_
SplatPropertyMap splatProperties_
Splat-property map.
Definition: SplatCloud.hh:476
typeId
DLLEXPORT DataType typeId(QString _name)
Given a dataType Identifier string this function will return the id of the datatype.
Definition: Types.cc:139
SplatCloud::View::featureIdx_
int featureIdx_
SIFT-feature index.
Definition: SplatCloud.hh:499
SplatCloud::pointsizes
Pointsize & pointsizes(int _idx)
Get a reference of the predefined property&#39;s value.
Definition: SplatCloud.hh:637
SplatCloud::CloudPropertyInterface::~CloudPropertyInterface
virtual ~CloudPropertyInterface()
Destructor.
Definition: SplatCloud.hh:235
SplatCloud::getSplatProperty
SplatPropertyT< T > * getSplatProperty(const PropertyHandleT< T > &_handle)
Get a pointer to a property.
Definition: SplatCloudT_impl.hh:345
SplatCloud::viewlists
Viewlist & viewlists(int _idx)
Get a reference of the predefined property&#39;s value.
Definition: SplatCloud.hh:641
SplatCloud::requestPointsizes
bool requestPointsizes()
Request the predefined property.
Definition: SplatCloud.hh:564