From 723ab5427ce27d62388b2e71fe4ef6b05f389f70 Mon Sep 17 00:00:00 2001 From: srn Date: Thu, 26 Jan 2006 11:43:10 +0000 Subject: [PATCH] added VisualParameters interface --- src/SalomeApp/Makefile.in | 6 +- src/SalomeApp/SalomeApp_VisualParameters.cxx | 144 +++++++++++++++++++ src/SalomeApp/SalomeApp_VisualParameters.h | 66 +++++++++ 3 files changed, 214 insertions(+), 2 deletions(-) create mode 100644 src/SalomeApp/SalomeApp_VisualParameters.cxx create mode 100644 src/SalomeApp/SalomeApp_VisualParameters.h diff --git a/src/SalomeApp/Makefile.in b/src/SalomeApp/Makefile.in index 308e5126b..ca78f8ae2 100755 --- a/src/SalomeApp/Makefile.in +++ b/src/SalomeApp/Makefile.in @@ -25,7 +25,8 @@ EXPORT_HEADERS= SalomeApp.h \ SalomeApp_Filter.h \ SalomeApp_TypeFilter.h \ SalomeApp_StudyPropertiesDlg.h \ - SalomeApp_CheckFileDlg.h + SalomeApp_CheckFileDlg.h \ + SalomeApp_VisualParameters.h # .po files to transform in .qm PO_FILES = SalomeApp_images.po \ @@ -48,7 +49,8 @@ LIB_SRC= SalomeApp_Module.cxx \ SalomeApp_TypeFilter.cxx \ SalomeApp_StudyPropertiesDlg.cxx \ SalomeApp_ListView.cxx \ - SalomeApp_CheckFileDlg.cxx + SalomeApp_CheckFileDlg.cxx \ + SalomeApp_VisualParameters.cxx LIB_MOC = SalomeApp_Application.h \ SalomeApp_DataModel.h \ diff --git a/src/SalomeApp/SalomeApp_VisualParameters.cxx b/src/SalomeApp/SalomeApp_VisualParameters.cxx new file mode 100644 index 000000000..18fbdbd40 --- /dev/null +++ b/src/SalomeApp/SalomeApp_VisualParameters.cxx @@ -0,0 +1,144 @@ +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ +// +#include "SalomeApp_VisualParameters.h" +#include + +using namespace std; + +/*! + Constructor +*/ +SalomeApp_VisualParameters::SalomeApp_VisualParameters(_PTR(SComponent), const int savePoint) +{ +} + +/*! + sets a color for the obect with id \a entry +*/ +void SalomeApp_VisualParameters::setColor(const string& entry, vector color) +{ +} + +/*! + returns a color for the obect with id \a entry +*/ +vector SalomeApp_VisualParameters::getColor(const string& entry) +{ + vector v; + return v; +} + +/*! + sets a transparency for the obect with id \a entry +*/ +void SalomeApp_VisualParameters::setTransparency(const string& entry, const double& value) +{ +} + +/*! + returns a transparency for the obect with id \a entry +*/ +double SalomeApp_VisualParameters::getTransparency(const string& entry) +{ + return 0.0; +} + +/*! + sets a line width for the obect with id \a entry +*/ +void SalomeApp_VisualParameters::setLineWidth(const string& entry, const double& value) +{ +} + +/*! + returns a line width for the obect with id \a entry +*/ +double SalomeApp_VisualParameters::getLineWidth(const string& entry) +{ + return 0.0; +} + +/*! + sets a represenatation mode of the obect with id \a entry +*/ +void SalomeApp_VisualParameters::setPresentationMode(const string& entry, const int mode) +{ +} + +/*! + returns a represenatation mode of the obect with id \a entry +*/ +int SalomeApp_VisualParameters::getPresentationMode(const string& entry) +{ + return -1; +} + +/*! + marks the object with id \a entry as displayed +*/ +void SalomeApp_VisualParameters::setDisplayed(const string& entry) +{ +} + +/*! + returns true if the object with id \a entry is displayed +*/ +bool SalomeApp_VisualParameters::isDisplayed(const string& entry) +{ + return false; +} + +/*! + sets a type of the displayed object with id \a entry +*/ +void SalomeApp_VisualParameters::setTypeOfDisplayed(const string& entry, const int type) +{ +} + +/*! + gets a type of displayed object with id \a entry +*/ +int SalomeApp_VisualParameters::getTypeOfDisplayed(const string& entry) +{ + return -1; +} + +/*! + sets clipping plane definitions for the object with id \a entry +*/ +void SalomeApp_VisualParameters::setClipping(const string& entry, vector color) +{ +} + +/*! + returns clipping plane definitions for the object with id \a entry +*/ +vector SalomeApp_VisualParameters::getClipping(const string& entry) +{ + vector v; + return v; +} + +/*! + returns an AttributeParameter attribute +*/ +_PTR(AttributeParameter) SalomeApp_VisualParameters::getContainer() +{ + return _ap; +} diff --git a/src/SalomeApp/SalomeApp_VisualParameters.h b/src/SalomeApp/SalomeApp_VisualParameters.h new file mode 100644 index 000000000..6b5f545b3 --- /dev/null +++ b/src/SalomeApp/SalomeApp_VisualParameters.h @@ -0,0 +1,66 @@ +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ +// +#ifndef SALOMEAPP_VisualParameters_H +#define SALOMEAPP_VisualParameters_H + +#include "SalomeApp.h" + +#include +#include + +#include + +/*! + Class which an interface to store the visual parameters of the objects +*/ +class SALOMEAPP_EXPORT SalomeApp_VisualParameters +{ +public: + SalomeApp_VisualParameters(_PTR(SComponent), const int savePoint); + + void setColor(const std::string& entry, std::vector color); + std::vector getColor(const std::string& entry); + + void setTransparency(const std::string& entry, const double& value); + double getTransparency(const std::string& entry); + + void setLineWidth(const std::string& entry, const double& value); + double getLineWidth(const std::string& entry); + + void setPresentationMode(const std::string& entry, const int mode); + int getPresentationMode(const std::string& entry); + + void setDisplayed(const std::string& entry); + bool isDisplayed(const std::string& entry); + + void setTypeOfDisplayed(const std::string& entry, const int type); + int getTypeOfDisplayed(const std::string& entry); + + void setClipping(const std::string& entry, std::vector color); + std::vector getClipping(const std::string& entry); + + _PTR(AttributeParameter) getContainer(); + + + private: + _PTR(AttributeParameter) _ap; + +}; + +#endif -- 2.39.2