58 #include "Snappy/snappy.h" 70 static const int COLORRANGE_0_1 = 0;
77 FilePTSPlugin::FilePTSPlugin() :
92 loadMakeDefaultButton_( 0 ),
93 saveMakeDefaultButton_( 0 )
98 void FilePTSPlugin::initializePlugin()
101 "This plugin is based on the Snappy compression library by google<br> " 103 "The following license applies to their code: <br> " 104 "Copyright 2005 Google Inc.All Rights Reserved. <br>" 106 "Redistribution and use in source and binary forms, with or without <br>" 107 "modification, are permitted provided that the following conditions are <br>" 110 " *Redistributions of source code must retain the above copyright <br>" 111 "notice, this list of conditions and the following disclaimer. <br>" 112 " * Redistributions in binary form must reproduce the above <br>" 113 "copyright notice, this list of conditions and the following disclaimer <br>" 114 "in the documentation and / or other materials provided with the <br>" 116 " * Neither the name of Google Inc.nor the names of its <br>" 117 "contributors may be used to endorse or promote products derived from <br>" 118 "this software without specific prior written permission. <br>" 120 "THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <br>" 121 "\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT <br>" 122 "LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <br>" 123 "A PARTICULAR PURPOSE ARE DISCLAIMED.IN NO EVENT SHALL THE COPYRIGHT <br>" 124 "OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, <br>" 125 "SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES(INCLUDING, BUT NOT <br>" 126 "LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, <br>" 127 "DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY <br>" 128 "THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT <br>" 129 "(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE <br>" 130 "OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
132 emit addAboutInfo(info,
"FilePTS");
173 bool FilePTSPlugin::readBinaryFile(
const char *_filename,
SplatCloud &_splatCloud )
186 if( OpenFlipper::Options::gui() && loadOptions_ )
188 loadNormals = loadNormals_-> isChecked();
189 loadPointsizes = loadPointsizes_->isChecked();
190 loadColors = loadColors_-> isChecked();
192 loadIndices = loadIndices_-> isChecked();
198 if( loadNormals ) {
if( !_splatCloud.
requestNormals() ) success =
false; }
200 if( loadColors ) {
if( !_splatCloud.
requestColors() ) success =
false; }
201 if( loadIndices ) {
if( !_splatCloud.
requestIndices() ) success =
false; }
206 emit log(
LOGERR, tr(
"Out of memory for input file \"%1\".\n").arg( _filename ) );
211 FILE *file = fopen( _filename,
"rb" );
214 emit log(
LOGERR, tr(
"Could not open input file \"%1\".\n").arg( _filename ) );
220 fread( &fileType,
sizeof(
int), 1, file );
223 if( fileType != 1 && fileType != 2 && fileType != 3 )
225 emit log(
LOGERR, tr(
"Bad filetype (%1) in input file \"%2\".\n").arg( QString::number( fileType ), _filename ) );
231 unsigned int numSplats = 0;
232 fread( &numSplats,
sizeof(
unsigned int), 1, file );
242 for (i = 0; i < numSplats; ++i)
245 fread(pos,
sizeof(
float), 3, file);
248 position[0] = pos[0];
249 position[1] = pos[1];
250 position[2] = pos[2];
260 for (i = 0; i < numSplats; ++i)
263 fread(nrm,
sizeof(
float), 3, file);
270 _splatCloud.
normals(i) = normal;
278 for (i = 0; i < numSplats; ++i)
281 fread(&ps,
sizeof(
float), 1, file);
283 SplatCloud::Pointsize pointsize;
294 for (i = 0; i < numSplats; ++i)
296 unsigned int col = 0;
297 fread(&col,
sizeof(
unsigned int), 1, file);
300 color[0] = (
unsigned char)((col >> 16) & 0xFF);
301 color[1] = (
unsigned char)((col >> 8) & 0xFF);
302 color[2] = (
unsigned char)((col) & 0xFF);
304 _splatCloud.
colors(i) = color;
312 for (i = 0; i < numSplats; ++i)
315 fread(&idx,
sizeof(idx), 1, file);
317 SplatCloud::Index index;
320 _splatCloud.
indices(i) = index;
324 else if (fileType == 3)
328 int numProperties = 0;
329 fread(&numProperties,
sizeof(
int), 1, file);
331 for (
int propID = 0; propID < numProperties; ++propID)
337 fread(&propNameLen,
sizeof(
int), 1, file);
338 std::string propName(propNameLen, 0);
340 fread(&propName[0], 1, propNameLen, file);
344 fread(&dataType,
sizeof(
int), 1, file);
347 quint64 compressedSize = 0;
348 fread(&compressedSize,
sizeof(quint64), 1, file);
349 size_t compressedSizeT =
static_cast<size_t>(compressedSize);
354 if (dataType == SplatDataFileFormat::FLOATVEC3)
356 if (propName ==
"Points")
357 readCompressedBinaryChunk(file, compressedSizeT, reinterpret_cast<char*>(&_splatCloud.
positions(0)));
358 else if (propName ==
"Normals" && loadNormals)
359 readCompressedBinaryChunk(file, compressedSizeT, reinterpret_cast<char*>(&_splatCloud.
normals(0)));
361 fseek(file, static_cast<long>(compressedSizeT), SEEK_CUR);
363 else if (dataType == SplatDataFileFormat::FLOAT)
365 if (propName ==
"Radii" && loadPointsizes)
366 readCompressedBinaryChunk(file, compressedSizeT, reinterpret_cast<char*>(&_splatCloud.
pointsizes(0)));
368 fseek(file, static_cast<long>(compressedSizeT), SEEK_CUR);
370 else if (dataType == SplatDataFileFormat::UINT16)
372 fseek(file, static_cast<long>(compressedSizeT), SEEK_CUR);
374 else if (dataType == SplatDataFileFormat::UINT32)
376 if (propName ==
"Colors" && loadColors)
378 std::vector<ACG::Vec4uc> fileColors(numSplats);
379 readCompressedBinaryChunk(file, compressedSizeT, reinterpret_cast<char*>(&fileColors[0]));
381 for (uint i = 0; i < numSplats; ++i)
383 for (
int k = 0; k < 3; ++k)
384 _splatCloud.
colors(i)[k] = fileColors[i][k];
388 fseek(file, static_cast<long>(compressedSizeT), SEEK_CUR);
390 else if (dataType == SplatDataFileFormat::INT32)
392 fseek(file, static_cast<long>(compressedSizeT), SEEK_CUR);
396 emit log(
LOGWARN, tr(
"Unknown Property type. \"%1\".\n").arg(_filename));
397 fseek(file, static_cast<long>(compressedSizeT), SEEK_CUR);
408 emit log(
LOGERR, tr(
"Could not read input file \"%1\".\n").arg( _filename ) );
414 emit log(
LOGERR, tr(
"Unexpected end in input file \"%1\".\n").arg( _filename ) );
430 bool FilePTSPlugin::readTextFile(
const char *_filename,
SplatCloud &_splatCloud )
443 if( OpenFlipper::Options::gui() && loadOptions_ )
445 loadNormals = loadNormals_ ->isChecked();
446 loadPointsizes = loadPointsizes_->isChecked();
447 loadColors = loadColors_ ->isChecked();
448 loadColorRange = loadColorRange_->currentIndex();
449 loadIndices = loadIndices_ ->isChecked();
455 if( loadNormals ) {
if( !_splatCloud.
requestNormals() ) success =
false; }
457 if( loadColors ) {
if( !_splatCloud.
requestColors() ) success =
false; }
458 if( loadIndices ) {
if( !_splatCloud.
requestIndices() ) success =
false; }
463 emit log(
LOGERR, tr(
"Out of memory for input file \"%1\".\n").arg( _filename ) );
468 FILE *file = fopen( _filename,
"rb" );
471 emit log(
LOGERR, tr(
"Could not open input file \"%1\".\n").arg( _filename ) );
477 for( splatIdx = 0; ; ++splatIdx )
483 const int read = fscanf( file,
"%32f %32f %32f", &pos[0], &pos[1], &pos[2] );
485 emit log(
LOGERR, tr(
"Scanned for 3 coordinates but got %1 at Index %2.\n").arg( read ).arg(splatIdx) );
493 position[0] = pos[0];
494 position[1] = pos[1];
495 position[2] = pos[2];
497 _splatCloud.
positions( splatIdx ) = position;
505 const int read = fscanf( file,
"%32f %32f %32f", &col[0], &col[1], &col[2] );
507 emit log(
LOGERR, tr(
"Scanned for 3 colors but got %1 at Index %2.\n").arg( read ).arg(splatIdx) );
513 if( loadColorRange == COLORRANGE_0_1 )
515 color[0] = (
unsigned char) (255.999f * col[0]);
516 color[1] = (
unsigned char) (255.999f * col[1]);
517 color[2] = (
unsigned char) (255.999f * col[2]);
521 color[0] = (
unsigned char) col[0];
522 color[1] = (
unsigned char) col[1];
523 color[2] = (
unsigned char) col[2];
526 _splatCloud.
colors( splatIdx ) = color;
533 fscanf( file,
"%32f %32f %32f", &nrm[0], &nrm[1], &nrm[2] );
540 _splatCloud.
normals( splatIdx ) = normal;
547 fscanf( file,
"%32f", &ps );
549 SplatCloud::Pointsize pointsize;
552 _splatCloud.
pointsizes( splatIdx ) = pointsize;
559 fscanf( file,
"%16i", &idx );
561 SplatCloud::Index index;
564 _splatCloud.
indices( splatIdx ) = index;
570 emit log(
LOGERR, tr(
"Could not read input file \"%1\".\n").arg( _filename ) );
576 emit log(
LOGERR, tr(
"Unexpected end in input file \"%1\".\n").arg( _filename ) );
586 emit log(
LOGERR, tr(
"Bad file format of input file \"%1\".\n").arg( _filename ) );
602 bool FilePTSPlugin::writeBinaryFile(
const char *_filename,
const SplatCloudNode *_splatCloudNode )
612 if( OpenFlipper::Options::gui() && saveOptions_ )
614 saveNormals = saveNormals_-> isChecked();
615 savePointsizes = savePointsizes_->isChecked();
616 saveColors = saveColors_-> isChecked();
618 saveIndices = saveIndices_-> isChecked();
635 FILE *file = fopen( _filename,
"wb" );
638 emit log(
LOGERR, tr(
"Could not open output file \"%1\".\n").arg( _filename ) );
644 fwrite( &fileType,
sizeof(
int), 1, file );
647 unsigned int numSplats = _splatCloudNode->splatCloud().
numSplats();
648 fwrite( &numSplats,
sizeof(
unsigned int), 1, file );
653 for( i=0; i<numSplats; ++i )
658 pos[0] = position[0];
659 pos[1] = position[1];
660 pos[2] = position[2];
662 fwrite( pos,
sizeof(
float), 3, file );
670 for( i=0; i<numSplats; ++i )
679 fwrite( nrm,
sizeof(
float), 3, file );
687 for( i=0; i<numSplats; ++i )
689 const SplatCloud::Pointsize &pointsize = _splatCloudNode->getPointsize( i );
694 fwrite( &ps,
sizeof(
float), 1, file );
702 for( i=0; i<numSplats; ++i )
707 col = (0xFF << 24) | (color[0] << 16) | (color[1] << 8) | (color[2]);
709 fwrite( &col,
sizeof(
unsigned int), 1, file );
717 for( i=0; i<numSplats; ++i )
719 const SplatCloud::Index &index = _splatCloudNode->getIndex( i );
724 fwrite( &idx,
sizeof(
int), 1, file );
731 emit log(
LOGERR, tr(
"Could not write output file \"%1\".\n").arg( _filename ) );
747 bool FilePTSPlugin::writeTextFile(
const char *_filename,
const SplatCloudNode *_splatCloudNode )
757 if( OpenFlipper::Options::gui() && saveOptions_ )
759 saveNormals = saveNormals_-> isChecked();
760 savePointsizes = savePointsizes_->isChecked();
761 saveColors = saveColors_-> isChecked();
762 saveColorRange = saveColorRange_->currentIndex();
763 saveIndices = saveIndices_-> isChecked();
780 FILE *file = fopen( _filename,
"wt" );
783 emit log(
LOGERR, tr(
"Could not open output file \"%1\".\n").arg( _filename ) );
788 unsigned int i, numSplats = _splatCloudNode->splatCloud().
numSplats();
789 for( i=0; i<numSplats; ++i )
796 pos[0] = position[0];
797 pos[1] = position[1];
798 pos[2] = position[2];
800 fprintf( file,
"%.6g %.6g %.6g", pos[0], pos[1], pos[2] );
808 if( saveColorRange == COLORRANGE_0_1 )
810 static const float RCP255 = 1.0f / 255.0f;
813 col[0] = RCP255 * color[0];
814 col[1] = RCP255 * color[1];
815 col[2] = RCP255 * color[2];
817 fprintf( file,
" %.6g %.6g %.6g", col[0], col[1], col[2] );
826 fprintf( file,
" %i %i %i", col[0], col[1], col[2] );
840 fprintf( file,
" %.6g %.6g %.6g", nrm[0], nrm[1], nrm[2] );
846 const SplatCloud::Pointsize &pointsize = _splatCloudNode->getPointsize( i );
851 fprintf( file,
" %.6g", ps );
857 const SplatCloud::Index &index = _splatCloudNode->getIndex( i );
862 fprintf( file,
" %i", idx );
865 fprintf( file,
"\n" );
871 emit log(
LOGERR, tr(
"Could not write output file \"%1\".\n").arg( _filename ) );
887 bool FilePTSPlugin::readCompressedBinaryChunk(FILE* _file,
size_t _compressedSize,
char* _dst)
889 std::vector<char> compressedData(_compressedSize);
890 fread(&compressedData[0], 1, _compressedSize, _file);
891 return snappy::RawUncompress(&compressedData[0], _compressedSize, _dst);
897 int FilePTSPlugin::loadObject( QString _filename )
903 if( OpenFlipper::Options::gui() && loadOptions_ )
905 loadBinaryFile = loadBinaryFile_->isChecked();
909 int splatCloudObjectId = -1;
911 if( splatCloudObjectId != -1 )
915 objectIDs.push_back( splatCloudObjectId );
928 if( (splatCloud != 0) && (splatCloudNode != 0) )
931 if( loadBinaryFile ? readBinaryFile( _filename.toLatin1(), *splatCloud ) : readTextFile( _filename.toLatin1(), *splatCloud ) )
935 emit openedFile( splatCloudObjectId );
947 emit log(
LOGERR, tr(
"Shader DrawModes for SplatCloud not existent!") );
959 drawmode |= pointsDrawMode;
965 int groupObjectId = RPC::callFunctionValue<int>(
"datacontrol",
"groupObjects", objectIDs );
966 if( groupObjectId != -1 )
969 return groupObjectId;
976 size_t i, num = objectIDs.size();
977 for( i=0; i<num; ++i )
989 bool FilePTSPlugin::saveObject(
int _objectId, QString _filename )
995 if( OpenFlipper::Options::gui() && saveOptions_ )
997 saveBinaryFile = saveBinaryFile_->isChecked();
1010 if( splatCloudNode != 0 )
1013 if( saveBinaryFile ? writeBinaryFile( _filename.toLatin1(), splatCloudNode ) : writeTextFile( _filename.toLatin1(), splatCloudNode ) )
1031 if( loadOptions_ == 0 )
1035 loadBinaryFile_ =
new QCheckBox( tr(
"Load as Binary File") );
1037 loadNormals_ =
new QCheckBox( tr(
"Contains Normals") );
1038 loadPointsizes_ =
new QCheckBox( tr(
"Contains Pointsizes") );
1039 loadColors_ =
new QCheckBox( tr(
"Contains Colors") );
1041 loadColorRange_ =
new QComboBox();
1042 loadColorRange_->addItem(
"[0..1]" );
1043 loadColorRange_->addItem(
"[0..255]" );
1044 slotUpdateLoadColorRange();
1046 QHBoxLayout *loadColorsLayout =
new QHBoxLayout();
1047 loadColorsLayout->setSpacing( 6 );
1048 loadColorsLayout->addWidget( loadColors_ );
1049 loadColorsLayout->addWidget( loadColorRange_ );
1051 loadIndices_ =
new QCheckBox( tr(
"Contains Indices") );
1053 QVBoxLayout *loadStructureLayout =
new QVBoxLayout();
1054 loadStructureLayout->setSpacing( 6 );
1055 loadStructureLayout->addWidget( loadNormals_ );
1056 loadStructureLayout->addWidget( loadPointsizes_ );
1057 loadStructureLayout->addItem ( loadColorsLayout );
1058 loadStructureLayout->addWidget( loadIndices_ );
1060 QGroupBox *loadStructureGroupBox =
new QGroupBox( tr(
"Internal File Structure") );
1061 loadStructureGroupBox->setLayout( loadStructureLayout );
1063 loadMakeDefaultButton_ =
new QPushButton( tr(
"Make Default") );
1065 QVBoxLayout *loadLayout =
new QVBoxLayout();
1066 loadLayout->setAlignment( Qt::AlignTop );
1067 loadLayout->setSpacing( 6 );
1068 loadLayout->addWidget( loadBinaryFile_ );
1069 loadLayout->addWidget( loadStructureGroupBox );
1070 loadLayout->addWidget( loadMakeDefaultButton_ );
1072 loadOptions_ =
new QWidget();
1073 loadOptions_->setLayout( loadLayout );
1076 connect( loadBinaryFile_, SIGNAL( stateChanged(
int) ),
this, SLOT( slotUpdateLoadColorRange() ) );
1077 connect( loadColors_, SIGNAL( stateChanged(
int) ),
this, SLOT( slotUpdateLoadColorRange() ) );
1078 connect( loadMakeDefaultButton_, SIGNAL( clicked() ),
this, SLOT( slotLoadMakeDefaultButtonClicked() ) );
1081 loadBinaryFile_-> setChecked (
OpenFlipperSettings().value(
"FilePTS/Load/BinaryFile",
true ).toBool() );
1082 loadNormals_-> setChecked (
OpenFlipperSettings().value(
"FilePTS/Load/Normals",
true ).toBool() );
1083 loadPointsizes_-> setChecked (
OpenFlipperSettings().value(
"FilePTS/Load/Pointsizes",
true ).toBool() );
1084 loadColors_-> setChecked (
OpenFlipperSettings().value(
"FilePTS/Load/Colors",
true ).toBool() );
1085 loadColorRange_-> setCurrentIndex(
OpenFlipperSettings().value(
"FilePTS/Load/ColorRange", 0 ).toInt() );
1086 loadIndices_-> setChecked (
OpenFlipperSettings().value(
"FilePTS/Load/Indices",
true ).toBool() );
1089 return loadOptions_;
1098 if( saveOptions_ == 0 )
1102 saveBinaryFile_ =
new QCheckBox( tr(
"Save as Binary File") );
1104 saveNormals_ =
new QCheckBox( tr(
"Save Normals") );
1105 savePointsizes_ =
new QCheckBox( tr(
"Save Pointsizes") );
1106 saveColors_ =
new QCheckBox( tr(
"Save Colors") );
1108 saveColorRange_ =
new QComboBox();
1109 saveColorRange_->addItem(
"[0..1]" );
1110 saveColorRange_->addItem(
"[0..255]" );
1111 slotUpdateSaveColorRange();
1113 QHBoxLayout *saveColorsLayout =
new QHBoxLayout();
1114 saveColorsLayout->setSpacing( 6 );
1115 saveColorsLayout->addWidget( saveColors_ );
1116 saveColorsLayout->addWidget( saveColorRange_ );
1118 saveIndices_ =
new QCheckBox( tr(
"Save Indices") );
1120 QVBoxLayout *saveStructureLayout =
new QVBoxLayout();
1121 saveStructureLayout->setSpacing( 6 );
1122 saveStructureLayout->addWidget( saveNormals_ );
1123 saveStructureLayout->addWidget( savePointsizes_ );
1124 saveStructureLayout->addItem ( saveColorsLayout );
1125 saveStructureLayout->addWidget( saveIndices_ );
1127 QGroupBox *saveStructureGroupBox =
new QGroupBox( tr(
"Internal File Structure") );
1128 saveStructureGroupBox->setLayout( saveStructureLayout );
1130 saveMakeDefaultButton_ =
new QPushButton( tr(
"Make Default") );
1132 QVBoxLayout *saveLayout =
new QVBoxLayout();
1133 saveLayout->setAlignment( Qt::AlignTop );
1134 saveLayout->setSpacing( 6 );
1135 saveLayout->addWidget( saveBinaryFile_ );
1136 saveLayout->addWidget( saveStructureGroupBox );
1137 saveLayout->addWidget( saveMakeDefaultButton_ );
1139 saveOptions_ =
new QWidget();
1140 saveOptions_->setLayout( saveLayout );
1143 connect( saveBinaryFile_, SIGNAL( stateChanged(
int) ),
this, SLOT( slotUpdateSaveColorRange() ) );
1144 connect( saveColors_, SIGNAL( stateChanged(
int) ),
this, SLOT( slotUpdateSaveColorRange() ) );
1145 connect( saveMakeDefaultButton_, SIGNAL( clicked() ),
this, SLOT( slotSaveMakeDefaultButtonClicked() ) );
1148 saveBinaryFile_->setChecked (
OpenFlipperSettings().value(
"FilePTS/Save/BinaryFile",
true ).toBool() );
1149 saveNormals_-> setChecked (
OpenFlipperSettings().value(
"FilePTS/Save/Normals",
true ).toBool() );
1150 savePointsizes_->setChecked (
OpenFlipperSettings().value(
"FilePTS/Save/Pointsizes",
true ).toBool() );
1151 saveColors_-> setChecked (
OpenFlipperSettings().value(
"FilePTS/Save/Colors",
true ).toBool() );
1152 saveColorRange_->setCurrentIndex(
OpenFlipperSettings().value(
"FilePTS/Save/ColorRange", 0 ).toInt() );
1153 saveIndices_-> setChecked (
OpenFlipperSettings().value(
"FilePTS/Save/Indices",
true ).toBool() );
1156 return saveOptions_;
1163 void FilePTSPlugin::slotUpdateLoadColorRange()
1165 loadColorRange_->setEnabled( loadColors_->isChecked() && !loadBinaryFile_->isChecked() );
1172 void FilePTSPlugin::slotUpdateSaveColorRange()
1174 saveColorRange_->setEnabled( saveColors_->isChecked() && !saveBinaryFile_->isChecked() );
1181 void FilePTSPlugin::slotLoadMakeDefaultButtonClicked()
1198 void FilePTSPlugin::slotSaveMakeDefaultButtonClicked()
DLLEXPORT OpenFlipperQSettings & OpenFlipperSettings()
QSettings object containing all program settings of OpenFlipper.
QWidget * loadOptionsWidget(QString)
const UpdateType UPDATE_ALL(UpdateTypeSet(1))
Identifier for all updates.
void setName(QString _name)
Set the name of the Object.
bool requestIndices()
Request the predefined property.
QWidget * saveOptionsWidget(QString)
const DrawMode & getDrawMode(const std::string &_name)
Get a custom DrawMode.
Color & colors(int _idx)
Get a reference of the predefined property's value.
void setFromFileName(const QString &_filename)
void setValue(const QString &key, const QVariant &value)
Wrapper function which makes it possible to enable Debugging output with -DOPENFLIPPER_SETTINGS_DEBUG...
Normal & normals(int _idx)
Get a reference of the predefined property's value.
virtual void updatedObject(int _objectId)
An object has been changed or added by this plugin.
bool requestPositions()
Request the predefined property.
virtual void deleteObject(int _id)
Delete an object This signal can be called from any thread. .
void setDrawMode(const ACG::SceneGraph::DrawModes::DrawMode &_mode, int _viewer)
Set the draw Mode of a Viewer. .
Position & positions(int _idx)
Get a reference of the predefined property's value.
bool getObject(const int _identifier, BaseObject *&_object)
Get the object which has the given identifier.
Index & indices(int _idx)
Get a reference of the predefined property's value.
QString filename() const
return the filename of the object
std::vector< int > IdList
Standard Type for id Lists used for scripting.
unsigned int numSplats() const
Get the number of splats.
DrawMode NONE
not a valid draw mode
ACG::SceneGraph::DrawModes::DrawMode drawMode(int _viewer)
Get the current draw Mode of a Viewer.
SplatCloud * splatCloud()
Get SplatCloud.
void clear()
Remove all properties and reset the number of splats.
SplatCloud * splatCloud(BaseObjectData *_object)
Get a SplatCloud from an object.
void pushbackSplat()
Add one element at the end of the data vector of all splat-properties.
bool requestNormals()
Request the predefined property.
bool requestColors()
Request the predefined property.
QVariant value(const QString &key, const QVariant &defaultValue=QVariant()) const
void resizeSplats(unsigned int _num)
Resize the data vector of all splat-properties.
SplatCloudObject * splatCloudObject(BaseObjectData *_object)
Cast an SplatCloudObject to a SplatCloudObject if possible.
SplatCloudNode * splatCloudNode(BaseObjectData *_object)
Get a SplatCloudNode from an object.
bool containsAtomicDrawMode(const DrawMode &_atomicDrawMode) const
Check whether an Atomic DrawMode is active in this draw Mode.
SplatCloudNode * splatCloudNode()
Get SplatCloud's scenegraph Node.
const Position & getPosition(int _idx) const
if the data array exists, the entry with the given index is returned, otherwise the default value is ...
Pointsize & pointsizes(int _idx)
Get a reference of the predefined property's value.
bool requestPointsizes()
Request the predefined property.