45 #include "ViewControlPlugin.hh" 46 #include <OpenFlipper/INIFile/INIFile.hh> 48 #include <OpenFlipper/ACGHelper/DrawModeConverter.hh> 49 #include <ACG/Scenegraph/CoordsysNode.hh> 51 #include <QWidgetAction> 52 #include <QInputDialog> 54 #define SHOW_SELECTION "Show/Hide Selections" 55 #define SHOW_AREAS "Show/Hide All Modeling Areas" 56 #define SHOW_AREA "Show/Hide Modeling Area" 57 #define SHOW_HANDLE "Show/Hide Handle Area" 58 #define SHOW_FEATURES "Show/Hide Feature Selection" 59 #define SIZE_SELECTION "Set Selection Width" 60 #define SIZE_FEATURES "Set Feature Width" 61 #define USEGLOBALDRAWMODE "Use Global DrawMode" 62 #define SETSHADERS "Set Shader" 64 ViewControlPlugin::ViewControlPlugin():
69 toolbarViewingDirections_(0),
80 void ViewControlPlugin::pluginsInitialized() {
83 OpenFlipper::Options::drawModesInContextMenu(
false);
86 viewControlMenu_ =
new QMenu(
"Visualization");
89 QIcon icon = QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+
"drawModes.png");
90 viewControlMenu_->setIcon(icon);
94 if(it->name ==
"Unknown" || it->name ==
"Group" || it->name ==
"All")
continue;
95 emit addContextMenuItem(viewControlMenu_->menuAction(), it->type,
CONTEXTOBJECTMENU );
98 connect( viewControlMenu_, SIGNAL( triggered(QAction*) ),
this, SLOT( contextMenuTriggered(QAction*) ));
103 toolbar_ =
new QToolBar(tr(
"Viewing Directions"));
106 toolbarViewingDirections_ =
new QActionGroup(toolbar_);
107 QString iconPath = OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator();
110 viewTop_ =
new QAction( QIcon(iconPath +
"viewcontrol_top.png"), tr(
"View from top") , toolbarViewingDirections_);
111 toolbar_->addAction( viewTop_ );
112 viewBottom_ =
new QAction( QIcon(iconPath +
"viewcontrol_bottom.png"), tr(
"View from bottom") , toolbarViewingDirections_);
113 toolbar_->addAction( viewBottom_ );
114 viewLeft_ =
new QAction( QIcon(iconPath +
"viewcontrol_left.png"), tr(
"View from left") , toolbarViewingDirections_);
115 toolbar_->addAction( viewLeft_ );
116 viewRight_ =
new QAction( QIcon(iconPath +
"viewcontrol_right.png"), tr(
"View from right") , toolbarViewingDirections_);
117 toolbar_->addAction( viewRight_ );
118 viewFront_ =
new QAction( QIcon(iconPath +
"viewcontrol_front.png"), tr(
"View from front") , toolbarViewingDirections_);
119 toolbar_->addAction( viewFront_ );
120 viewBack_ =
new QAction( QIcon(iconPath +
"viewcontrol_back.png"), tr(
"View from back") , toolbarViewingDirections_);
121 toolbar_->addAction( viewBack_ );
123 connect( toolbarViewingDirections_, SIGNAL( triggered(QAction*) ),
this, SLOT(setView(QAction*)) );
126 emit addToolbar(toolbar_);
131 void ViewControlPlugin::updateShaderList() {
137 QStringList shadersDirs = OpenFlipper::Options::shaderDir().entryList( QDir::Dirs| QDir::NoDotAndDotDot ,QDir::Name);
139 for (
int i = 0 ; i < shadersDirs.size(); ++i ) {
142 QFileInfo descriptionFile(OpenFlipper::Options::shaderDirStr() +
143 OpenFlipper::Options::dirSeparator() +
144 shadersDirs[i] + OpenFlipper::Options::dirSeparator() +
"shader.ini" );
147 if ( !descriptionFile.exists() || !ini.
connect( descriptionFile.filePath() ,false ) ) {
148 emit log(
LOGWARN,
"Unable to open description file for shader " + shadersDirs[i] +
" at " + descriptionFile.filePath() );
150 info.description =
"Unknown";
151 info.version =
"Unknown";
152 info.name = shadersDirs[i];
153 info.details =
"----------";
162 info.name = shadersDirs[i];
163 emit log(
LOGWARN,
"Unable to get name from description file for shader " + shadersDirs[i] );
166 if ( ini.
get_entry(tmp,
"Info",
"description") )
167 info.description = tmp;
169 info.description =
"Unknown";
170 emit log(
LOGWARN,
"Unable to get shader description from description file for shader " + shadersDirs[i] );
173 if ( ini.
get_entry(tmp,
"Info",
"details") )
176 info.details =
"----------";
177 emit log(
LOGWARN,
"Unable to get shader details from description file for shader " + shadersDirs[i] );
180 if ( ini.
get_entry(tmp,
"Info",
"version") )
183 info.version =
"Unknown";
184 emit log(
LOGWARN,
"Unable to get shader version from description file for shader " + shadersDirs[i] );
187 if ( ini.
get_entry(tmp,
"Info",
"example") )
188 info.example = OpenFlipper::Options::shaderDirStr() + OpenFlipper::Options::dirSeparator() +
189 shadersDirs[i] + OpenFlipper::Options::dirSeparator() + tmp;
192 emit log(
LOGWARN,
"Unable to get example image from Description file for shader " + shadersDirs[i] );
195 if ( ini.
get_entry(tmp,
"FragmentShader",
"file") )
196 info.fragmentShader = tmp;
198 info.fragmentShader =
"Fragment.glsl";
199 emit log(
LOGWARN,
"Unable to get fragment shader filename from Description file for shader " + shadersDirs[i] );
202 if ( ini.
get_entry(tmp,
"VertexShader",
"file") )
203 info.vertexShader = tmp;
205 info.vertexShader =
"Vertex.glsl";
206 emit log(
LOGWARN,
"Unable to get vertex shader filename from Description file for shader " + shadersDirs[i] );
209 if ( ini.
get_entry(tmp,
"PickVertexShader",
"file") )
210 info.pickVertexShader = tmp;
212 info.pickVertexShader =
"";
214 if ( ini.
get_entry(tmp,
"PickFragmentShader",
"file") )
215 info.pickFragmentShader = tmp;
217 info.pickFragmentShader =
"";
220 std::vector<QString> uniforms;
221 if ( ini.
get_entry(uniforms,
"Info",
"uniforms") ) {
222 info.hasUniforms =
true;
223 for ( uint uniform = 0 ; uniform < uniforms.size() ; ++uniform)
224 info.uniforms << uniforms[uniform];
226 info.hasUniforms =
false;
227 info.uniforms.clear();
232 if ( info.hasUniforms && ini.
get_entry(uniforms,
"Info",
"uniformTypes") ) {
233 for ( uint uniform = 0 ; uniform < uniforms.size() ; ++uniform)
234 info.uniformTypes << uniforms[uniform];
235 }
else if ( info.hasUniforms ) {
236 info.hasUniforms =
false;
237 info.uniforms.clear();
238 info.uniformTypes.clear();
239 emit log(
LOGERR,
"Uniforms for shader " + shadersDirs[i] +
" defined but no type available, disabled uniforms." );
244 if ( info.hasUniforms && ini.
get_entry(uniforms,
"Info",
"uniformsDefault" ) ) {
245 for ( uint uniform = 0 ; uniform < uniforms.size() ; ++uniform)
246 info.uniformsDefault << uniforms[uniform];
247 }
else if ( info.hasUniforms ) {
248 info.hasUniforms =
false;
249 info.uniforms.clear();
250 info.uniformTypes.clear();
251 emit log(
LOGERR,
"Uniforms for shader " + shadersDirs[i] +
" defined but no defaults available, disabled uniforms." );
255 if ( info.hasUniforms && ini.
get_entry(uniforms,
"Info",
"uniformsMin" ) ) {
256 for ( uint uniform = 0 ; uniform < uniforms.size() ; ++uniform)
257 info.uniformsMin << uniforms[uniform];
258 }
else if ( info.hasUniforms )
259 info.uniformsMin = info.uniformsDefault;
263 if ( info.hasUniforms && ini.
get_entry(uniforms,
"Info",
"uniformsMax" ) ) {
264 for ( uint uniform = 0 ; uniform < uniforms.size() ; ++uniform)
265 info.uniformsMax << uniforms[uniform];
266 }
else if ( info.hasUniforms )
267 info.uniformsMax = info.uniformsDefault;
272 info.directory = descriptionFile.path();
274 QFileInfo vertexShaderFile( info.directory + OpenFlipper::Options::dirSeparator() + info.vertexShader );
275 if ( !vertexShaderFile.exists() ) {
276 emit log(
LOGERR,
"Unable to find vertex shader file " + vertexShaderFile.filePath() );
280 QFileInfo fragmentShaderFile( info.directory + OpenFlipper::Options::dirSeparator() + info.fragmentShader );
281 if ( !fragmentShaderFile.exists() ) {
282 emit log(
LOGERR,
"Unable to find fragment shader file " + fragmentShaderFile.filePath() );
286 shaderList_.push_back(info);
292 void ViewControlPlugin::contextMenuTriggered(QAction* _action){
293 if ( _action->text() == SHOW_SELECTION) {
295 QVariant contextObject = _action->data();
296 int objectId = contextObject.toInt();
301 showSelection( objectId , !selectionVisible( objectId) );
306 if ( _action->text() == SIZE_SELECTION) {
308 QVariant contextObject = _action->data();
309 int objectId = contextObject.toInt();
321 double d = QInputDialog::getDouble(0, tr(
"Line width for features"),
322 tr(
"Size:"), 2.0, 1.0, 50.0, 2, &ok,
323 Qt::WindowFlags(), 1);
324 setSelectionLineWidth(objectId,d);
330 double d = QInputDialog::getDouble(0, tr(
"Line width for features"),
331 tr(
"Size:"), 2.0, 1.0, 50.0, 2, &ok,
332 Qt::WindowFlags(), 1);
333 setSelectionLineWidth(objectId,d);
340 if ( _action->text() == SHOW_AREAS) {
342 QVariant contextObject = _action->data();
343 int objectId = contextObject.toInt();
348 showModelingAreas( objectId, !modelingAreasVisible(objectId) );
353 if ( _action->text() == SHOW_AREA) {
355 QVariant contextObject = _action->data();
356 int objectId = contextObject.toInt();
361 showAreas( AREA, objectId, !areasVisible(AREA,objectId) );
366 if ( _action->text() == SHOW_HANDLE) {
368 QVariant contextObject = _action->data();
369 int objectId = contextObject.toInt();
374 showAreas( HANDLEAREA, objectId, !areasVisible(HANDLEAREA,objectId) );
379 if ( _action->text() == SHOW_FEATURES) {
381 QVariant contextObject = _action->data();
382 int objectId = contextObject.toInt();
399 if ( polyMeshObject )
407 if ( _action->text() == SIZE_FEATURES) {
409 QVariant contextObject = _action->data();
410 int objectId = contextObject.toInt();
422 double d = QInputDialog::getDouble(0, tr(
"Line width for features"),
423 tr(
"Size:"), 2.0, 1.0, 50.0, 2, &ok,
424 Qt::WindowFlags(), 1);
425 setFeatureLineWidth(objectId,d);
431 double d = QInputDialog::getDouble(0, tr(
"Line width for features"),
432 tr(
"Size:"), 2.0, 1.0, 50.0, 2, &ok,
433 Qt::WindowFlags(), 1);
434 setFeatureLineWidth(objectId,d);
443 if ( _action->text() == SETSHADERS ) {
444 if ( shaderWidget_ == 0 ) {
446 connect(shaderWidget_->availableShaders,SIGNAL(itemClicked(QListWidgetItem*)),
447 this ,SLOT(slotShaderClicked(QListWidgetItem*)));
448 connect(shaderWidget_->availableShaders,SIGNAL(itemDoubleClicked(QListWidgetItem*)),
449 this ,SLOT(slotShaderDoubleClicked(QListWidgetItem*)));
451 connect(shaderWidget_->setShaderButton,SIGNAL(clicked()),
this, SLOT(slotSetShader()));
452 connect(shaderWidget_->closeButton,SIGNAL(clicked()),shaderWidget_, SLOT(close()));
454 connect(shaderWidget_->uniforms, SIGNAL(itemChanged(QTableWidgetItem*)),
455 this, SLOT(itemChanged(QTableWidgetItem*)) );
460 shaderWidget_->show();
483 if ( polyMeshObject )
501 if ( triMeshObject ) {
508 if ( polyMeshObject )
517 return areasVisible(StatusBits(HANDLEAREA | AREA), _id);
532 triMeshObject->
hideArea( _bits, !_state);
537 if ( polyMeshObject )
538 polyMeshObject->
hideArea( _bits, !_state);
544 showAreas(StatusBits(HANDLEAREA | AREA) , _id, _state );
560 triMeshObject->
statusNode()->material().lineWidth(_width );
565 if ( polyMeshObject )
566 polyMeshObject->
statusNode()->material().lineWidth(_width );
584 triMeshObject->
featureNode()->material().lineWidth(_width );
589 if ( polyMeshObject )
590 polyMeshObject->
featureNode()->material().lineWidth(_width );
613 if ( polyMeshObject )
619 void ViewControlPlugin::slotUpdateContextMenu(
int _objectId ){
621 viewControlMenu_->clear();
623 lastObjectId_ = _objectId;
627 emit log(
LOGERR,
"Unable to create Context Menu ... Unable to get Object");
634 act = viewControlMenu_->addAction( SHOW_SELECTION );
635 act->setCheckable(
true);
637 act->setStatusTip(
"Switch visualization for selection on/off" );
638 act->setToolTip(
"Switch visualization for selection on/off" );
639 act->setWhatsThis(
"Switch the visualization of your current selections on and off." );
641 act->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+
"selections.png"));
651 if ( polyMeshObject )
658 act = viewControlMenu_->addAction( SHOW_AREAS );
659 act->setCheckable(
true);
661 act->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+
"areaSelections.png"));
666 act->setChecked( triMeshObject->
areaVisible( StatusBits(HANDLEAREA | AREA) ) );
671 if ( polyMeshObject )
672 act->setChecked( polyMeshObject->
areaVisible( StatusBits(HANDLEAREA | AREA) ) );
679 act = viewControlMenu_->addAction( SHOW_HANDLE );
680 act->setCheckable(
true);
682 act->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+
"viewcontrol_handleSelection.png"));
687 act->setChecked( triMeshObject->
areaVisible( HANDLEAREA ) );
692 if ( polyMeshObject )
693 act->setChecked( polyMeshObject->
areaVisible( HANDLEAREA ) );
699 act = viewControlMenu_->addAction( SHOW_AREA );
700 act->setCheckable(
true);
702 act->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+
"viewcontrol_modelingSelection.png"));
707 act->setChecked( triMeshObject->
areaVisible( AREA ) );
712 if ( polyMeshObject )
713 act->setChecked( polyMeshObject->
areaVisible( AREA ) );
721 act = viewControlMenu_->addAction( SHOW_FEATURES );
722 act->setCheckable(
true);
724 act->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+
"viewcontrol_featureSelections.png"));
734 if ( polyMeshObject )
741 act = viewControlMenu_->addAction( SIZE_FEATURES );
743 act->setCheckable(
true);
745 act->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+
"viewcontrol_featureSize.png"));
750 act = viewControlMenu_->addAction( SIZE_SELECTION );
752 act->setCheckable(
true);
754 act->setIcon(QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+
"viewcontrol_selectionSize.png"));
760 viewControlMenu_->addSeparator();
762 QAction* act = viewControlMenu_->addAction( SETSHADERS );
763 act->setCheckable(
false );
766 viewControlMenu_->addSeparator();
768 QActionGroup * globalDrawActionsGroup =
new QActionGroup(
this );
770 QAction * action =
new QAction( USEGLOBALDRAWMODE , globalDrawActionsGroup );
771 action->setCheckable(
false );
773 viewControlMenu_->addActions(globalDrawActionsGroup->actions());
775 connect( globalDrawActionsGroup, SIGNAL( triggered( QAction * ) ),
776 this , SLOT( slotDrawModeSelected( QAction * ) ) );
778 QActionGroup * drawGroup =
new QActionGroup(
this );
779 drawGroup->setExclusive(
false );
784 availDrawModes_ = actionAvailable.
drawModes();
789 activeDrawModes_ = actionActive.
drawMode();
791 std::vector< ACG::SceneGraph::DrawModes::DrawMode > availDrawModeIds;
792 availDrawModeIds = availDrawModes_.getAtomicDrawModes();
798 activeCheckboxes.clear();
799 for (
unsigned int i = 0; i < availDrawModeIds.size(); ++i )
802 std::string descr =
id.description();
804 QCheckBox *checkBox =
new QCheckBox(QString(descr.c_str()), viewControlMenu_);
805 activeCheckboxes[checkBox] = id;
806 if (activeDrawModes_.containsAtomicDrawMode(
id))
807 checkBox->setCheckState(Qt::Checked);
809 checkBox->setCheckState(Qt::PartiallyChecked);
811 checkBox->setCheckState(Qt::Unchecked);
812 QWidgetAction *checkableAction =
new QWidgetAction(drawGroup);
813 checkableAction->setText(descr.c_str());
814 checkableAction->setDefaultWidget(checkBox);
815 connect(checkBox, SIGNAL( stateChanged(
int) ), checkableAction, SLOT(trigger() ) );
818 viewControlMenu_->addActions( drawGroup->actions() );
820 connect( drawGroup, SIGNAL( triggered( QAction * ) ),
821 this, SLOT( slotDrawModeSelected( QAction * ) ) );
825 void ViewControlPlugin::slotDrawModeSelected( QAction * _action) {
827 QWidgetAction *
const wdgtAction =
dynamic_cast<QWidgetAction*
>(_action);
828 QCheckBox *
const checkbox = wdgtAction ?
dynamic_cast<QCheckBox*
>(wdgtAction->defaultWidget()) : 0;
829 const bool activateDrawMode = checkbox ? (checkbox->checkState() != Qt::Unchecked) :
false;
835 std::vector< ACG::SceneGraph::DrawModes::DrawMode > availDrawModeIds;
836 availDrawModeIds = availDrawModes_.getAtomicDrawModes();
837 for (
unsigned int i = 0; i < availDrawModeIds.size(); ++i )
839 QString descr = QString( availDrawModeIds[i].description().c_str() );
841 if ( descr == _action->text() ) {
842 mode = availDrawModeIds[i];
850 bool useGlobalDrawMode =
false;
851 bool contextMenuStaysOpen =
false;
852 if ( _action->text() != USEGLOBALDRAWMODE ) {
857 activeDrawModes_.combine(widgetDrawMode);
865 if ( qApp->keyboardModifiers() & Qt::ShiftModifier ) {
866 if (activateDrawMode) {
867 activeDrawModes_.combine(mode);
869 if (activeDrawModes_ == mode) {
871 useGlobalDrawMode =
true;
873 activeDrawModes_.
filter(mode);
876 contextMenuStaysOpen =
true;
878 if (activateDrawMode) {
879 activeDrawModes_ = mode ;
882 useGlobalDrawMode =
true;
884 emit hideContextMenu();
888 useGlobalDrawMode =
true;
894 useGlobalDrawMode =
true;
897 if (contextMenuStaysOpen) {
898 typedef std::map<QCheckBox*, ACG::SceneGraph::DrawModes::DrawMode> CBM;
900 for (CBM::iterator it = activeCheckboxes.begin(), it_end = activeCheckboxes.end(); it != it_end; ++it) {
901 it->first->blockSignals(
true);
902 if (activeDrawModes_.containsAtomicDrawMode(it->second)) {
903 it->first->setCheckState(Qt::Checked);
905 it->first->setCheckState(Qt::PartiallyChecked);
907 it->first->setCheckState(Qt::Unchecked);
909 it->first->blockSignals(
false);
933 void ViewControlPlugin::initShaderWidget(){
939 shaderWidget_->availableShaders->clear();
941 for ( uint i = 0 ; i < shaderList_.size(); ++i ) {
942 shaderWidget_->availableShaders->addItem( shaderList_[i].name );
945 shaderWidget_->availableShaders->setCurrentRow(0);
946 slotShaderClicked(shaderWidget_->availableShaders->currentItem());
950 void ViewControlPlugin::slotShaderClicked( QListWidgetItem * _item ){
952 for (
int i = 0 ; i < (int)shaderList_.size(); ++i) {
953 if ( shaderList_[i].name == _item->text() ) {
960 std::cerr <<
"Strange index Error! " << std::endl;
964 shaderWidget_->shaderName->setText( shaderList_[index].name );
965 shaderWidget_->description->setText( shaderList_[index].description );
966 shaderWidget_->details->setText( shaderList_[index].details );
967 shaderWidget_->version->setText( shaderList_[index].version );
968 shaderWidget_->vertexShader->setText( shaderList_[index].vertexShader );
969 shaderWidget_->fragmentShader->setText( shaderList_[index].fragmentShader );
970 shaderWidget_->pickVertexShader->setText( shaderList_[index].pickVertexShader );
971 shaderWidget_->pickFragmentShader->setText( shaderList_[index].pickFragmentShader );
972 shaderWidget_->example->setPixmap( QPixmap(shaderList_[index].example) );
975 QStringList shadersDirs = OpenFlipper::Options::shaderDir().entryList( QDir::Dirs| QDir::NoDotAndDotDot ,QDir::Name);
976 QString shaderDir = OpenFlipper::Options::shaderDirStr() + OpenFlipper::Options::dirSeparator();
978 QString vertexFile = shaderDir + shadersDirs[ shaderWidget_->availableShaders->currentRow() ] +
979 OpenFlipper::Options::dirSeparator() + shaderWidget_->vertexShader->text();
980 QString fragmentFile = shaderDir + shadersDirs[ shaderWidget_->availableShaders->currentRow() ] +
981 OpenFlipper::Options::dirSeparator() + shaderWidget_->fragmentShader->text();
984 shaderWidget_->drawModes->clear();
986 std::vector< ACG::SceneGraph::DrawModes::DrawMode > availDrawModeIds;
987 availDrawModeIds = availDrawModes_.getAtomicDrawModes( );
989 for (
unsigned int i = 0; i < availDrawModeIds.size(); ++i )
994 std::vector< QString > dm = drawModeToDescriptions(
id );
996 if ( !dm.empty() && dm[0].trimmed() !=
""){
997 QListWidgetItem* item =
new QListWidgetItem(dm[0]);
999 item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsUserCheckable | Qt::ItemIsSelectable);
1005 if ( object->
shaderNode()->vertexShaderName(
id ) == vertexFile.toStdString() &&
1006 object->shaderNode()->fragmentShaderName(
id ) == fragmentFile.toStdString() )
1007 item->setCheckState( Qt::Checked );
1012 item->setCheckState( Qt::Unchecked );
1015 shaderWidget_->drawModes->addItem(item);
1019 if ( shaderList_[index].hasUniforms ) {
1021 shaderWidget_->uniforms->clear();
1022 shaderWidget_->uniforms->setColumnCount ( 1 );
1023 shaderWidget_->uniforms->setRowCount ( shaderList_[index].uniforms.count() );
1025 shaderWidget_->uniforms->setHorizontalHeaderLabels( QStringList(
"Value") );
1026 shaderWidget_->uniforms->setVerticalHeaderLabels( shaderList_[index].uniforms );
1028 for (
int i=0; i < shaderList_[index].uniforms.count(); i++){
1029 QTableWidgetItem* item =
new QTableWidgetItem( shaderList_[index].uniformsDefault[i] );
1030 item->setFlags( Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsEnabled);
1031 shaderWidget_->uniforms->setItem(i,0,item );
1034 shaderWidget_->uniformBox->setVisible(
true );
1037 shaderWidget_->uniformBox->setVisible(
false );
1042 void ViewControlPlugin::slotShaderDoubleClicked( QListWidgetItem * ){
1046 void ViewControlPlugin::itemChanged(QTableWidgetItem* item){
1050 for (
int i = 0 ; i < (int)shaderList_.size(); ++i) {
1051 if ( shaderList_[i].name == shaderWidget_->availableShaders->currentItem()->text() ) {
1057 if ( index == -1 ) {
1058 std::cerr <<
"Error: Shader Index not found! " << std::endl;
1063 int row = item->row();
1065 if ( row > shaderList_[index].uniforms.count() ){
1066 std::cerr <<
"Error: uniform index out of bounds" << std::endl;
1071 if (shaderList_[index].uniformTypes[row] ==
"float"){
1074 float value = item->text().toFloat(&ok);
1077 item->setText( shaderList_[index].uniformsDefault[row] );
1078 else if (shaderList_[index].uniformsDefault[row] != shaderList_[index].uniformsMin[row]
1079 && value < shaderList_[index].uniformsMin[row].toFloat())
1080 item->setText( shaderList_[index].uniformsMin[row] );
1081 else if (shaderList_[index].uniformsDefault[row] != shaderList_[index].uniformsMin[row]
1082 && value > shaderList_[index].uniformsMax[row].toFloat())
1083 item->setText( shaderList_[index].uniformsMax[row] );
1088 void ViewControlPlugin::slotSetShader()
1093 for (
int i = 0; i < (int) shaderList_.size(); ++i) {
1094 if (shaderList_[i].name == shaderWidget_->availableShaders->currentItem()->text()) {
1101 std::cerr <<
"Error: Shader Index not found! " << std::endl;
1105 std::vector<QString> mode;
1106 for (
int i = 0; i < shaderWidget_->drawModes->count(); i++) {
1107 if (shaderWidget_->drawModes->item(i)->checkState() == Qt::Checked) {
1108 mode.push_back(shaderWidget_->drawModes->item(i)->text());
1109 setShader(lastObjectId_, descriptionsToDrawMode(mode), shaderList_[index]);
1112 mode.push_back(shaderWidget_->drawModes->item(i)->text());
1113 disableShader(lastObjectId_, descriptionsToDrawMode(mode), &shaderList_[index]);
1130 object->shaderNode()->disableShader(_drawMode);
1132 std::string shadeDir = _shader->directory.toStdString() + OpenFlipper::Options::dirSeparator().toStdString();
1134 if (object->
shaderNode()->vertexShaderName(_drawMode) == shadeDir + _shader->vertexShader.toStdString()
1135 &&
object->shaderNode()->fragmentShaderName(_drawMode) == shadeDir + _shader->fragmentShader.toStdString())
1145 if ( OpenFlipper::Options::nogui() )
1152 QFileInfo vertexFile (_shader.name + OpenFlipper::Options::dirSeparator() + _shader.vertexShader);
1153 QFileInfo fragmentFile (_shader.name + OpenFlipper::Options::dirSeparator() + _shader.fragmentShader);
1154 QFileInfo pickVertexFile (_shader.name + OpenFlipper::Options::dirSeparator() + _shader.pickVertexShader);
1155 QFileInfo pickFragmentFile (_shader.name + OpenFlipper::Options::dirSeparator() + _shader.pickFragmentShader);
1158 && _shader.vertexShader.length() && _shader.fragmentShader.length()) {
1160 if (vertexFile.absolutePath() != fragmentFile.absolutePath()) {
1161 emit log(
LOGERR,
"Cannot set shader. Currently shader files have to be in the same folder.");
1165 if (_shader.pickVertexShader.length() && _shader.pickFragmentShader.length())
1167 if (vertexFile.absolutePath() != pickVertexFile.absolutePath() ||
1168 vertexFile.absolutePath() != pickFragmentFile.absolutePath()) {
1169 emit log(
LOGERR,
"Cannot set picking shader. Currently shader files have to be in the same folder.");
1173 object->shaderNode()->setShaderDir( (_shader.directory + OpenFlipper::Options::dirSeparator()).toStdString() );
1175 object->shaderNode()->setShader(_drawMode,
1176 vertexFile.fileName().toStdString(),
1177 fragmentFile.fileName().toStdString(),
1178 pickVertexFile.fileName().toStdString(),
1179 pickFragmentFile.fileName().toStdString());
1183 object->shaderNode()->setShaderDir( (_shader.directory + OpenFlipper::Options::dirSeparator()).toStdString() );
1184 object->shaderNode()->setShader(_drawMode, vertexFile.fileName().toStdString(), fragmentFile.fileName().toStdString());
1190 if (_shader.hasUniforms) {
1192 if ( shader == 0 ) {
1193 std::cerr <<
"Error: Unable to get shader for shader mode" << std::endl;
1197 for (
int u=0; u < _shader.uniforms.count(); u++) {
1199 if (_shader.uniformTypes[u] ==
"float" ) {
1200 shaderWidget_->uniforms->setCurrentCell(u,0);
1201 float value = shaderWidget_->uniforms->currentItem()->text().toFloat();
1202 shader->
setUniform(_shader.uniforms[u].toUtf8(), value);
1205 if (_shader.uniformTypes[u] ==
"vec3" ) {
1206 shaderWidget_->uniforms->setCurrentCell(u,0);
1207 QStringList vecStr = shaderWidget_->uniforms->currentItem()->text().split(
",");
1208 if (vecStr.count() == 3) {
1209 ACG::Vec3f value( vecStr[0].toFloat(), vecStr[1].toFloat(), vecStr[2].toFloat() );
1210 shader->
setUniform(_shader.uniforms[u].toUtf8(), value);
1213 std::cerr <<
"Error: handling of uniformType '" << _shader.uniformTypes[u].toStdString() <<
"' not yet implemented" << std::endl;
1226 if ( OpenFlipper::Options::nogui() )
1233 for (
int i = 0 ; i < (int)shaderList_.size(); ++i) {
1234 if ( shaderList_[i].name == _name ) {
1240 if ( index == -1 ) {
1241 std::cerr <<
"Error: Shader not found! " << std::endl;
1245 std::vector <QString> mode;
1246 mode.push_back(_drawMode);
1248 setShader(_id, listToDrawMode(mode), shaderList_[index]);
1254 for (uint i=0; i < shaderList_.size(); i++)
1255 if ( shaderList_[i].name == _shader)
1256 return shaderList_[i].uniforms;
1258 return QStringList();
1261 QString ViewControlPlugin::getUniformType(QString _shader, QString _uniform ){
1263 for (uint i=0; i < shaderList_.size(); i++)
1264 if ( shaderList_[i].name == _shader){
1266 for (
int u=0; u < shaderList_[i].uniforms.count(); u++)
1267 if ( shaderList_[i].uniforms[u] == _uniform )
1268 return shaderList_[i].uniformTypes[u];
1274 QString ViewControlPlugin::getUniformDefault(QString _shader, QString _uniform ){
1276 for (uint i=0; i < shaderList_.size(); i++)
1277 if ( shaderList_[i].name == _shader){
1279 for (
int u=0; u < shaderList_[i].uniforms.count(); u++)
1280 if ( shaderList_[i].uniforms[u] == _uniform )
1281 return shaderList_[i].uniformsDefault[u];
1287 QString ViewControlPlugin::getUniformMin(QString _shader, QString _uniform ){
1289 for (uint i=0; i < shaderList_.size(); i++)
1290 if ( shaderList_[i].name == _shader){
1292 for (
int u=0; u < shaderList_[i].uniforms.count(); u++)
1293 if ( shaderList_[i].uniforms[u] == _uniform )
1294 return shaderList_[i].uniformsMin[u];
1300 QString ViewControlPlugin::getUniformMax(QString _shader, QString _uniform ){
1302 for (uint i=0; i < shaderList_.size(); i++)
1303 if ( shaderList_[i].name == _shader){
1305 for (
int u=0; u < shaderList_[i].uniforms.count(); u++)
1306 if ( shaderList_[i].uniforms[u] == _uniform )
1307 return shaderList_[i].uniformsMax[u];
1323 for (uint i=0; i < shaderList_.size(); i++)
1324 if ( shaderList_[i].name == _shader){
1327 if (shaderList_[i].hasUniforms){
1329 if ( shader == 0 ) {
1330 std::cerr <<
"Error: Unable to get shader for shader mode" << std::endl;
1334 for (
int u=0; u < shaderList_[i].uniforms.count(); u++){
1337 if ( shaderList_[i].uniforms[u] != _uniform )
1341 if (shaderList_[i].uniformTypes[u] ==
"float" )
1342 shader->
setUniform(shaderList_[i].uniforms[u].toUtf8(), _value.toFloat() );
1345 else if (shaderList_[i].uniformTypes[u] ==
"vec3" ){
1346 QStringList vecStr = _value.split(
",");
1347 if (vecStr.count() == 3){
1348 ACG::Vec3f value( vecStr[0].toFloat(), vecStr[1].toFloat(), vecStr[2].toFloat() );
1349 shader->
setUniform(shaderList_[i].uniforms[u].toUtf8(), value);
1352 std::cerr <<
"Error: handling of uniformType '" << shaderList_[i].uniformTypes[u].toStdString() <<
"' not yet implemented" << std::endl;
1388 if ( _viewer == PluginFunctions::ALL_VIEWERS )
1391 else if ( _viewer == PluginFunctions::ACTIVE_VIEWER )
1393 else if ( _viewer >= 0 && _viewer < PluginFunctions::viewers( ) )
1396 std::cerr <<
"Illegal viewer requested! " << std::endl;
1407 QStringList list = _mode.split(
';');
1409 std::vector< QString > drawModeList;
1411 for (
int i = 0 ; i < list.size() ; ++i )
1412 drawModeList.push_back(list[i]);
1428 QStringList list = _mode.split(
';');
1430 std::vector< QString > drawModeList;
1432 for (
int i = 0 ; i < list.size() ; ++i )
1433 drawModeList.push_back(list[i]);
1468 void ViewControlPlugin::setView(
int _mode,
int _viewer ) {
1471 case PluginFunctions::VIEW_TOP :
1474 case PluginFunctions::VIEW_BOTTOM :
1477 case PluginFunctions::VIEW_LEFT :
1480 case PluginFunctions::VIEW_RIGHT :
1483 case PluginFunctions::VIEW_FRONT :
1486 case PluginFunctions::VIEW_BACK :
1490 emit log(
LOGERR,
"ViewControl: Unknown view mode: " + QString::number(_mode));
1499 void ViewControlPlugin::setView(QAction* _action) {
1501 if ( _action == viewTop_) setView (PluginFunctions::VIEW_TOP, PluginFunctions::ACTIVE_VIEWER);
1502 else if ( _action == viewBottom_) setView (PluginFunctions::VIEW_BOTTOM, PluginFunctions::ACTIVE_VIEWER);
1503 else if ( _action == viewLeft_) setView (PluginFunctions::VIEW_LEFT, PluginFunctions::ACTIVE_VIEWER);
1504 else if ( _action == viewRight_) setView (PluginFunctions::VIEW_RIGHT, PluginFunctions::ACTIVE_VIEWER);
1505 else if ( _action == viewFront_) setView (PluginFunctions::VIEW_FRONT, PluginFunctions::ACTIVE_VIEWER);
1506 else if ( _action == viewBack_) setView (PluginFunctions::VIEW_BACK, PluginFunctions::ACTIVE_VIEWER);
1507 else emit log(
LOGERR,
"ViewControl: Unknown view mode action!");
1512 void ViewControlPlugin::setEyePosition(
Vector _eye){
1516 PluginFunctions::ACTIVE_VIEWER);
1572 if ( !_orthogonal) {
1579 emit log(
LOGERR,tr(
"setCoordsysProjection(): Could not find coordsys node, thus its projection mode will not be toggled."));
1584 void ViewControlPlugin::setTwoSidedLighting(
bool _enabled) {
1593 void ViewControlPlugin::setDescriptions() {
1594 emit setSlotDescription(
"translate(Vector,int)",
"Translate Scene",
1595 QString(
"TranslationVector,Viewer").split(
","),
1596 QString(
"vector for the translation.,Viewer id (default is all)").split(
","));
1597 emit setSlotDescription(
"translate(Vector)",
"Translate Scene in all Viewers",
1598 QString(
"TranslationVector").split(
","),
1599 QString(
"vector for the translation.").split(
","));
1600 emit setSlotDescription(
"rotate(Vector,double,Vector,int)",
"Rotate Scene",
1601 QString(
"Axis,Angle,Center,Viewer").split(
","),
1602 QString(
"Rotation axis., Rotation Angle., Rotation Center.").split(
","));
1603 emit setSlotDescription(
"rotate(Vector,double,Vector)",
"Rotate Scene in all viewers",
1604 QString(
"Axis,Angle,Center").split(
","),
1605 QString(
"Rotation axis., Rotation Angle., Rotation Center.").split(
","));
1606 emit setSlotDescription(
"setViewingDirection(Vector,Vector,int)",
"Set the viewing direction",
1607 QString(
"direction,upVector,Viewer").split(
","),
1608 QString(
"Viewing direction., Up-Vector.,Viewer id (default is all)").split(
","));
1609 emit setSlotDescription(
"setViewingDirection(Vector,Vector)",
"Set the viewing direction in all viewers",
1610 QString(
"direction,upVector").split(
","),
1611 QString(
"Viewing direction., Up-Vector.").split(
","));
1612 emit setSlotDescription(
"setDrawMode(QString,int)",
"Set the drawMode",
1613 QString(
"DrawMode,Viewer").split(
","),
1614 QString(
"the drawMode ( ; separated list ),Viewer id (default is all)").split(
","));
1615 emit setSlotDescription(
"setDrawMode(QString)",
"Set the drawMode for all viewers",
1617 QStringList(
"DrawMode"), QStringList(
"the drawMode ( ; separated list )"));
1619 emit setSlotDescription(
"setObjectDrawMode(QString,int,bool)",
"Set the drawMode for an object",
1620 QString(
"DrawMode,ObjectID,Force").split(
","),
1621 QString(
"the drawMode ( ; separated list ),Object id,Apply without checking support(default is true)").split(
","));
1623 emit setSlotDescription(
"viewAll()",
"Change View on all viewers to view whole scene",
1624 QStringList(), QStringList());
1625 emit setSlotDescription(
"viewAll(int)",
"Change View on given viewer to view whole scene",
1626 QStringList(
"Viewer"), QStringList(
"Id of the viewer to change"));
1628 emit setSlotDescription(
"viewHome()",
"Change View on all viewers to view home position",
1629 QStringList(), QStringList());
1630 emit setSlotDescription(
"viewHome(int)",
"Change View on given viewer to view home position",
1631 QStringList(
"Viewer"), QStringList(
"Id of the viewer to change"));
1634 emit setSlotDescription(
"orthographicProjection()",
"Change Viewer to orthographic projection",
1635 QStringList(), QStringList());
1636 emit setSlotDescription(
"orthographicProjection(int)",
"Change all Viewers to orthographic projection",
1637 QStringList(
"Viewer"), QStringList(
"Id of the viewer to change"));
1640 emit setSlotDescription(
"perspectiveProjection()",
"Change Viewer to perspective projection",
1641 QStringList(), QStringList());
1642 emit setSlotDescription(
"perspectiveProjection(int)",
"Change all Viewers to perspective projection",
1643 QStringList(
"Viewer"), QStringList(
"Id of the viewer to change"));
1645 emit setSlotDescription(
"setFOVY(double)",
"Set fovy angle of projection for all viewers.",
1646 QStringList(
"fovy"), QStringList(
"FOVY angle"));
1648 emit setSlotDescription(
"setCoordsysProjection(bool)",
"Set the projection mode of the coordinate system.",
1649 QStringList(
"orthogonal"), QStringList(
"If true, orthogonal projection otherwise perspective projection"));
1651 emit setSlotDescription(
"upVector()",
"Get the current upVector.",
1652 QStringList(), QStringList());
1654 emit setSlotDescription(
"upVector(int)",
"Get the current upVector of a specific viewer.",
1655 QStringList(
"ViewerId"), QStringList(
"Id of the viewer"));
1657 emit setSlotDescription(
"eyePosition()",
"Get the current eyePosition.",
1658 QStringList(), QStringList());
1660 emit setSlotDescription(
"eyePosition(int)",
"Get the current eyePosition of a specific viewer.",
1661 QStringList(
"ViewerId"), QStringList(
"Id of the viewer"));
1663 emit setSlotDescription(
"sceneCenter()",
"Get the current sceneCenter.",
1664 QStringList(), QStringList());
1666 emit setSlotDescription(
"sceneCenter(int)",
"Get the current sceneCenter of a specific viewer.",
1667 QStringList(
"ViewerId"), QStringList(
"Id of the viewer"));
1669 emit setSlotDescription(
"viewingDirection()",
"Get the current viewingDirection.",
1670 QStringList(), QStringList());
1672 emit setSlotDescription(
"viewingDirection(int)",
"Get the current viewingDirection of a specific viewer.",
1673 QStringList(
"ViewerId"), QStringList(
"Id of the viewer"));
1675 emit setSlotDescription(
"setTwoSidedLighting(bool)",
"Enable or disable two sided lighting.",
1676 QStringList(
"enabled"), QStringList(
"Specifies whether to enable or disable two sided lighting."));
DLLEXPORT std::vector< TypeInfo >::const_iterator typesEnd()
Get iterator pointing to the last element in the types list.
DrawModes::DrawMode drawModes() const
Get the collected draw modes.
void viewHome(int _viewer)
Go to home position.
bool areaVisible(StatusBits _bit)
Return if the selected areas are currently visible.
void setScenePos(const ACG::Vec3d &_center, const double _radius, int _viewer)
Set the Scene position.
void setUniform(int _objID, ACG::SceneGraph::DrawModes::DrawMode _drawMode, QString _shader, QString _uniform, QString _value)
set the value of a uniform in a shader for a specific drawMode
void orthographicProjection()
Change Viewer to orthographicProjection.
#define DATA_TRIANGLE_MESH
void showModelingAreas(int _id, bool _state)
Allows to enable/disable visualization of the objects modeling area for meshes.
Vector viewingDirection(int _viewer=PluginFunctions::ACTIVE_VIEWER)
Get a viewers viewing direction.
void hideSelection(bool _hide)
Hide or show the selection Node of the object.
void viewingDirection(const ACG::Vec3d &_dir, const ACG::Vec3d &_up, int _viewer)
Set the viewing direction.
Vector sceneCenter(int _viewer=PluginFunctions::ACTIVE_VIEWER)
Get the scene center.
void twoSidedLighting(bool _state)
set 2-sided lighting on/off
void use()
Enables the program object for using.
void disconnect()
Remove connection of this object to a file.
Type for a Meshobject containing a poly mesh.
Vector eyePosition(int _viewer=PluginFunctions::ACTIVE_VIEWER)
get a viewers eye Position
void hideFeatures(bool _hide)
Hide or show the feature Node of the object.
void setDrawMode(QString _mode, int _viewer=PluginFunctions::ALL_VIEWERS)
Set the draw mode for a viewer.
bool containsAtomicDrawMode(const DrawMode &_atomicDrawMode) const
Check whether an Atomic DrawMode is active in this draw Mode.
Vec3d project(const Vec3d &_point) const
project point in world coordinates to window coordinates
ACG::Vec3d upVector(int _viewer)
Get the current up vector.
void viewAll()
Change View on all viewers to view whole scene.
bool getObject(const int _identifier, BaseObject *&_object)
Get the object which has the given identifier.
DrawModes::DrawMode drawMode() const
Get the collected draw modes.
const ACG::Vec3d sceneCenter(int _viewer)
Get the current scene center.
void showAreas(StatusBits _bits, int _id, bool _state)
Show or hide modeling areas.
void disableShader(DrawModes::DrawMode _drawmode)
void viewHome()
Change View on given Viewer to view home position.
ACG::SceneGraph::BaseNode * getSceneGraphRootNode()
get scenegraph root node
void setProjectionMode(const ProjectionMode _mode)
set mode to either ORTHOGRAPHIC_PROJECTION or PERSPECTIVE_PROJECTION
void enableBackfaceCulling(bool _state, int _viewer=PluginFunctions::ALL_VIEWERS)
Enable or disable Backface culling.
ACG::SceneGraph::DrawModes::DrawMode drawMode(int _viewer)
Get the current draw Mode of a Viewer.
bool get_entry(QString &_val, const QString &_section, const QString &_key) const
Access to a string entry.
void setFeatureLineWidth(int _id, double _width)
Set the line width of the features.
void hideArea(StatusBits _bit, bool _hide)
Hide or show the area Nodes of the object.
unsigned int activeExaminer()
Get the id of the examiner which got the last mouse events.
void setFOVY(double _fovy)
Set fovy angle of projection.
ACG::SceneGraph::StatusNodeT< MeshT, FeatureNodeMod< MeshT > > * featureNode()
Returns the feature selection node if available, nullptr otherwise.
bool backFaceCulling()
Get current state of backface culling.
QStringList getUniforms(QString _shader)
get information about available uniforms for a given shader
bool dataType(DataType _type) const
void setSelectionLineWidth(int _id, double _width)
Set the line width of the selections.
void disableShader(int _objectId, ACG::SceneGraph::DrawModes::DrawMode _drawMode, ShaderInfo *_shader=0)
virtual BaseNode * primaryNode()
void setObjectDrawMode(QString _mode, int _objectID, bool _force=true)
Set the draw mode for an object.
bool selectionVisible(int _id)
For meshes returns if the selection for this object is visible.
DrawMode DEFAULT
use the default (global) draw mode and not the node's own.
void rotate(const ACG::Vec3d &_axis, const double _angle, const ACG::Vec3d &_center, int _viewer)
Rotate Scene around axis.
int viewers()
Get the number of viewers.
bool selectionVisible()
return if the selections are currently visible
void perspectiveProjection(int _viewer)
Switch to perspective Projection.
bool featuresVisible()
return if the feature Node of the object is currently visible
PolyMeshObject * polyMeshObject(BaseObjectData *_object)
Cast an BaseObject to a PolyMeshObject if possible.
ACG::Vec3d eyePos(int _viewer)
Get the current viewer position.
void setUniform(const char *_name, GLint _value)
Set int uniform to specified value.
ACG::Vec3d project(ACG::Vec3d _point, int _viewerId=0)
Use the projection matrix of the given viewer to project the point.
void disable()
Resets to standard rendering pipeline.
TriMeshObject * triMeshObject(BaseObjectData *_object)
Cast an BaseObject to a TriMeshObject if possible.
Type for a MeshObject containing a triangle mesh.
void filter(DrawMode _filter)
filter out one drawmode
void showSelection(int _id, bool _state)
Allows to enable/disable visualization of the objects selection for meshes.
void rotate(Vector _axis, double _angle, Vector _center, int _viewer=PluginFunctions::ALL_VIEWERS)
Rotate Scene.
bool areasVisible(StatusBits _bits, int _id)
Return of all of the given modeling areas are visible.
void setShader(int _id, ACG::SceneGraph::DrawModes::DrawMode _drawMode, ShaderInfo _shader)
bool modelingAreasVisible(int _id)
For meshes returns if the modeling areas for this object is visible.
void setCoordsysProjection(bool _orthogonal)
void lookAt(const ACG::Vec3d &_eye, const ACG::Vec3d &_center, const ACG::Vec3d &_up, int _viewer)
Set the look at transformation directly.
void setSceneCenter(Vector _center, int _viewer=PluginFunctions::ALL_VIEWERS)
Set the scene center.
void perspectiveProjection()
Change Viewer to perspectiveProjection.
void setDrawMode(const ACG::SceneGraph::DrawModes::DrawMode &_mode, int _viewer)
Set the draw Mode of a Viewer. .
void setViewingDirection(Vector _direction, Vector _upvector, int _viewer=PluginFunctions::ALL_VIEWERS)
Set the viewing direction.
void setSceneRadius(double _radius, int _viewer)
Set the background color of the examiner widget.
Class for the handling of simple configuration files.
bool connect(const QString &name, const bool create)
Connect INIFile object with given filename.
Viewer::ViewerProperties & viewerProperties(int _id)
Get the viewer properties Use this functions to get basic viewer properties such as backgroundcolor o...
void setSceneRadius(double _radius, int _viewer=PluginFunctions::ALL_VIEWERS)
Set scene radius.
void setFOVY(double _fovy)
Set field of view angle.
virtual ACG::SceneGraph::ShaderNode * shaderNode()
ChildIter find(BaseNode *_node)
void translate(const ACG::Vec3d &_vector, int _viewer)
Translate viewer pos by given vector.
void translate(Vector _vec, int _viewer=PluginFunctions::ALL_VIEWERS)
translate Scene
DLLEXPORT std::vector< TypeInfo >::const_iterator typesBegin()
Get iterator pointing to the first element in the types list.
Vector upVector(int _viewer=PluginFunctions::ACTIVE_VIEWER)
get a viewers up vector
void orthographicProjection(int _viewer)
Switch to orthographic Projection.
ProjectionMode getProjectionMode() const
get current projection mode
void traverse(BaseNode *_node, Action &_action)
ACG::SceneGraph::SelectionNodeT< MeshT > * statusNode()
ACG::GLState & glState()
Get the glState of the Viewer.
void viewAll(int _viewer)
View the whole scene.