ADD_SUBDIRECTORY (src/XGUI)
ADD_SUBDIRECTORY (src/ExchangePlugin)
ADD_SUBDIRECTORY (src/GeomValidators)
-ADD_SUBDIRECTORY (src/ViewFilters)
+ADD_SUBDIRECTORY (src/Filters)
ADD_SUBDIRECTORY (src/InitializationPlugin)
ADD_SUBDIRECTORY (src/ParametersPlugin)
ADD_SUBDIRECTORY (src/PythonAddons)
@ALL_SOLVERS@
-->
<plugin library="GeomValidators"/>
- <plugin library="ViewFilters"/>
+ <plugin library="Filters"/>
<plugin library="DFBrowser" internal="true"/>
<!--
<plugin library="SamplePanelPlugin" configuration="plugin-SamplePanel.xml"/>
--- /dev/null
+## Copyright (C) 2014-2017 CEA/DEN, EDF 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, or (at your option) any later version.
+##
+## 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/ or
+## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+##
+
+INCLUDE(Common)
+
+SET(PROJECT_HEADERS
+ Filters.h
+ Filters_Plugin.h
+ Filters_HorizontalPlane.h
+ Filters_VerticalPlane.h
+)
+
+SET(PROJECT_SOURCES
+ Filters_Plugin.cpp
+ Filters_HorizontalPlane.cpp
+ Filters_VerticalPlane.cpp
+)
+
+SET(PROJECT_LIBRARIES
+ ModelAPI
+ Events
+ Config
+ GeomAPI
+)
+
+ADD_DEFINITIONS(-DFILTERS_EXPORTS ${OpenCASCADE_DEFINITIONS})
+ADD_LIBRARY(Filters SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
+TARGET_LINK_LIBRARIES(Filters ${PROJECT_LIBRARIES})
+
+INCLUDE_DIRECTORIES(
+ ${OpenCASCADE_INCLUDE_DIR}
+ ${PROJECT_SOURCE_DIR}/src/ModelAPI
+ ${PROJECT_SOURCE_DIR}/src/Config
+ ${PROJECT_SOURCE_DIR}/src/Events
+ ${PROJECT_SOURCE_DIR}/src/GeomAPI
+ ${PROJECT_SOURCE_DIR}/src/GeomDataAPI
+)
+
+INSTALL(TARGETS Filters DESTINATION ${SHAPER_INSTALL_PLUGIN_FILES})
--- /dev/null
+// Copyright (C) 2014-2017 CEA/DEN, EDF 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, or (at your option) any later version.
+//
+// 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/ or
+// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+//
+
+#ifndef FILTERS_H
+#define FILTERS_H
+
+#if defined FILTERS_EXPORTS
+#if defined WIN32
+#define FILTERS_EXPORT __declspec( dllexport )
+#else
+#define FILTERS_EXPORT
+#endif
+#else
+#if defined WIN32
+#define FILTERS_EXPORT __declspec( dllimport )
+#else
+#define FILTERS_EXPORT
+#endif
+#endif
+
+#endif
--- /dev/null
+// Copyright (C) 2014-2017 CEA/DEN, EDF 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, or (at your option) any later version.
+//
+// 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/ or
+// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+//
+
+#include "Filters_HorizontalPlane.h"
+
+#include <GeomAPI_Face.h>
+#include <GeomAPI_Pln.h>
+
+bool Filters_HorizontalPlane::isOk(const GeomShapePtr& theShape) const
+{
+ if (!theShape->isFace())
+ return false;
+
+ if (!theShape->isPlanar())
+ return false;
+ GeomFacePtr aFace = std::dynamic_pointer_cast<GeomAPI_Face>(theShape);
+
+ GeomPlanePtr aPlane = aFace->getPlane();
+ GeomDirPtr aDir = aPlane->direction();
+ if (aDir->isParallel(GeomDirPtr(new GeomAPI_Dir(0,0,1))))
+ return true;
+ return false;
+}
+
+std::list<int> Filters_HorizontalPlane::shapeTypes() const
+{
+ std::list<int> aList;
+ aList.push_back(GeomAPI_Shape::FACE);
+ return aList;
+}
--- /dev/null
+// Copyright (C) 2014-2017 CEA/DEN, EDF 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, or (at your option) any later version.
+//
+// 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/ or
+// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+//
+
+#ifndef FILTERS_HORIZONTALPLANE_H_
+#define FILTERS_HORIZONTALPLANE_H_
+
+#include "Filters.h"
+
+#include <ModelAPI_Filter.h>
+
+class Filters_HorizontalPlane : public ModelAPI_Filter
+{
+public:
+ virtual bool isOk(const GeomShapePtr& theShape) const;
+
+ /// Returns list of supported types of shapes (see GeomAPI_Shape::ShapeType)
+ virtual std::list<int> shapeTypes() const;
+
+ /// Returns name of the filter to represent it in GUI
+ virtual std::string name() const { return "Horizontal faces"; }
+};
+
+
+#endif
\ No newline at end of file
--- /dev/null
+// Copyright (C) 2014-2017 CEA/DEN, EDF 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, or (at your option) any later version.
+//
+// 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/ or
+// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+//
+
+#include "Filters_Plugin.h"
+#include "Filters_HorizontalPlane.h"
+#include "Filters_VerticalPlane.h"
+
+#include <ModelAPI_Session.h>
+#include <ModelAPI_Filter.h>
+
+// the only created instance of this plugin
+static Filters_Plugin* MY_VIEWFILTERS_INSTANCE = new Filters_Plugin();
+
+Filters_Plugin::Filters_Plugin()
+{
+ // register validators
+ SessionPtr aMgr = ModelAPI_Session::get();
+ ModelAPI_FiltersFactory* aFactory = aMgr->filters();
+ aFactory->registerFilter("HorizontalFaces", new Filters_HorizontalPlane);
+ aFactory->registerFilter("VerticalFaces", new Filters_VerticalPlane);
+
+ // Do not register this plugin because it doesn't creates features
+ //ModelAPI_Session::get()->registerPlugin(this);
+}
+
+FeaturePtr Filters_Plugin::createFeature(std::string theFeatureID)
+{
+ // feature of such kind is not found
+ return FeaturePtr();
+}
--- /dev/null
+// Copyright (C) 2014-2017 CEA/DEN, EDF 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, or (at your option) any later version.
+//
+// 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/ or
+// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+//
+
+#ifndef FILTERS_PLUGIN_H_
+#define FILTERS_PLUGIN_H_
+
+#include "Filters.h"
+#include <ModelAPI_Plugin.h>
+#include <ModelAPI_Feature.h>
+
+/**\class GeomValidators_Plugin
+ * \ingroup Plugins
+ * \brief Interface common for any plugin: allows to use plugin by the plugins manager.
+ */
+class FILTERS_EXPORT Filters_Plugin : public ModelAPI_Plugin
+{
+public:
+ /// Creates the feature object of this plugin by the feature string ID
+ virtual FeaturePtr createFeature(std::string theFeatureID);
+
+public:
+ Filters_Plugin();
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2014-2017 CEA/DEN, EDF 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, or (at your option) any later version.
+//
+// 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/ or
+// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+//
+
+#include "Filters_VerticalPlane.h"
+
+#include <GeomAPI_Face.h>
+#include <GeomAPI_Pln.h>
+
+bool Filters_VerticalPlane::isOk(const GeomShapePtr& theShape) const
+{
+ if (!theShape->isFace())
+ return false;
+
+ if (!theShape->isPlanar())
+ return false;
+ GeomFacePtr aFace = std::dynamic_pointer_cast<GeomAPI_Face>(theShape);
+
+ GeomPlanePtr aPlane = aFace->getPlane();
+ GeomDirPtr aDir = aPlane->direction();
+ if (aDir->z() <= 1.e-7)
+ return true;
+ return false;
+}
+
+std::list<int> Filters_VerticalPlane::shapeTypes() const
+{
+ std::list<int> aList;
+ aList.push_back(GeomAPI_Shape::FACE);
+ return aList;
+}
--- /dev/null
+// Copyright (C) 2014-2017 CEA/DEN, EDF 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, or (at your option) any later version.
+//
+// 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/ or
+// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+//
+
+#ifndef FILTERS_VERTICALPLANE_H_
+#define FILTERS_VERTICALPLANE_H_
+
+#include "Filters.h"
+
+#include <ModelAPI_Filter.h>
+
+class Filters_VerticalPlane : public ModelAPI_Filter
+{
+public:
+ virtual bool isOk(const GeomShapePtr& theShape) const;
+
+ /// Returns list of supported types of shapes (see GeomAPI_Shape::ShapeType)
+ virtual std::list<int> shapeTypes() const;
+
+ /// Returns name of the filter to represent it in GUI
+ virtual std::string name() const { return "Vertical faces"; }
+};
+
+
+#endif
\ No newline at end of file
aFactory->registerValidator("GeomValidators_NotSelfIntersected",
new GeomValidators_NotSelfIntersected);
- // register this plugin
- ModelAPI_Session::get()->registerPlugin(this);
+ // Do not register this plugin because it doesn't creates features
+ //ModelAPI_Session::get()->registerPlugin(this);
}
FeaturePtr GeomValidators_Plugin::createFeature(std::string theFeatureID)
Model_FeatureValidator.h
Model_AttributeValidator.h
Model_SelectionNaming.h
- Model_ViewFilter.h
+ Model_Filter.h
)
SET(PROJECT_SOURCES
Model_FeatureValidator.cpp
Model_AttributeValidator.cpp
Model_SelectionNaming.cpp
- Model_ViewFilter.cpp
+ Model_Filter.cpp
)
SET(PROJECT_LIBRARIES
--- /dev/null
+// Copyright (C) 2014-2017 CEA/DEN, EDF 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, or (at your option) any later version.
+//
+// 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/ or
+// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+//
+
+#include "Model_Filter.h"
+
+#include <Events_InfoMessage.h>
+
+
+void Model_FiltersFactory::registerFilter(const std::string& theID, ModelAPI_Filter* theFilter)
+{
+ if (myFilters.find(theID) != myFilters.end()) {
+ Events_InfoMessage("Model_FiltersFactory", "Filter %1 is already registered").arg(theID).send();
+ }
+ else {
+ myFilters[theID] = FilterPtr(theFilter);
+ }
+}
+
+/// Returns list of filters for the given shape type
+/// \param theType a shape type
+std::list<FilterPtr> Model_FiltersFactory::filtersForShapeType(GeomAPI_Shape::ShapeType theType)
+{
+ std::list<FilterPtr> aResult;
+ std::map<std::string, FilterPtr>::const_iterator aIt;
+ std::list<int> aTypes;
+ std::list<int>::const_iterator aTIt;
+ for (aIt = myFilters.cbegin(); aIt != myFilters.cend(); aIt++) {
+ aTypes = aIt->second->shapeTypes();
+ for (aTIt = aTypes.cbegin(); aTIt != aTypes.cend(); aTIt++) {
+ if ((*aTIt) == theType) {
+ aResult.push_back(aIt->second);
+ break;
+ }
+ }
+ }
+ return aResult;
+}
--- /dev/null
+#pragma once
+// Copyright (C) 2014-2017 CEA/DEN, EDF 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, or (at your option) any later version.
+//
+// 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/ or
+// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+//
+
+#ifndef Model_Filter_H_
+#define Model_Filter_H_
+
+#include "Model.h"
+
+#include <ModelAPI_Filter.h>
+
+#include <map>
+
+
+/**\class Model_ValidatorsFactory
+* \ingroup DataModel
+* \brief Manages registering of filters
+*/
+class Model_FiltersFactory : public ModelAPI_FiltersFactory
+{
+public:
+ /// Register an instance of a filter
+ /// \param theID
+ virtual void registerFilter(const std::string& theID, ModelAPI_Filter* theFilter);
+
+ /// Returns list of filters for the given shape type
+ /// \param theType a shape type
+ virtual std::list<FilterPtr> filtersForShapeType(GeomAPI_Shape::ShapeType theType);
+
+protected:
+ /// Get instance from Session
+ Model_FiltersFactory() {}
+
+private:
+ std::map<std::string, FilterPtr> myFilters; ///< map from ID to registered filters
+
+ friend class Model_Session;
+};
+
+
+#endif
\ No newline at end of file
#include <Model_Application.h>
#include <Model_Events.h>
#include <Model_Validator.h>
-#include <Model_ViewFilter.h>
+#include <Model_Filter.h>
#include <ModelAPI_Events.h>
#include <Events_Loop.h>
#include <Events_InfoMessage.h>
+++ /dev/null
-// Copyright (C) 2014-2017 CEA/DEN, EDF 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, or (at your option) any later version.
-//
-// 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/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
-//
-
-#include "Model_ViewFilter.h"
-
-#include <Events_InfoMessage.h>
-
-
-void Model_FiltersFactory::registerFilter(const std::string& theID, ModelAPI_ViewFilter* theFilter)
-{
- if (myFilters.find(theID) != myFilters.end()) {
- Events_InfoMessage("Model_ViewFilter", "Filter %1 is already registered").arg(theID).send();
- }
- else {
- myFilters[theID] = FilterPtr(theFilter);
- }
-}
-
-/// Returns list of filters for the given shape type
-/// \param theType a shape type
-std::list<FilterPtr> Model_FiltersFactory::filtersForShapeType(GeomAPI_Shape::ShapeType theType)
-{
- std::list<FilterPtr> aResult;
- std::map<std::string, FilterPtr>::const_iterator aIt;
- std::list<int> aTypes;
- std::list<int>::const_iterator aTIt;
- for (aIt = myFilters.cbegin(); aIt != myFilters.cend(); aIt++) {
- aTypes = aIt->second->shapeTypes();
- for (aTIt = aTypes.cbegin(); aTIt != aTypes.cend(); aTIt++) {
- if ((*aTIt) == theType) {
- aResult.push_back(aIt->second);
- break;
- }
- }
- }
- return aResult;
-}
+++ /dev/null
-#pragma once
-// Copyright (C) 2014-2017 CEA/DEN, EDF 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, or (at your option) any later version.
-//
-// 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/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
-//
-
-#ifndef Model_ViewFilter_H_
-#define Model_ViewFilter_H_
-
-#include "Model.h"
-
-#include <ModelAPI_ViewFilter.h>
-
-#include <map>
-
-
-/**\class Model_ValidatorsFactory
-* \ingroup DataModel
-* \brief Manages registering of filters
-*/
-class Model_FiltersFactory : public ModelAPI_FiltersFactory
-{
-public:
- /// Register an instance of a filter
- /// \param theID
- virtual void registerFilter(const std::string& theID, ModelAPI_ViewFilter* theFilter);
-
- /// Returns list of filters for the given shape type
- /// \param theType a shape type
- virtual std::list<FilterPtr> filtersForShapeType(GeomAPI_Shape::ShapeType theType);
-
-protected:
- /// Get instance from Session
- Model_FiltersFactory() {}
-
-private:
- std::map<std::string, FilterPtr> myFilters; ///< map from ID to registered filters
-
- friend class Model_Session;
-};
-
-
-#endif
\ No newline at end of file
ModelAPI_Tools.h
ModelAPI_Validator.h
ModelAPI_Entity.h
- ModelAPI_ViewFilter.h
+ ModelAPI_Filter.h
)
SET(PROJECT_SOURCES
--- /dev/null
+// Copyright (C) 2014-2017 CEA/DEN, EDF 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, or (at your option) any later version.
+//
+// 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/ or
+// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+//
+
+#ifndef ModelAPI_Filter_H_
+#define ModelAPI_Filter_H_
+
+#include "ModelAPI.h"
+#include "ModelAPI_Object.h"
+
+#include <GeomAPI_Shape.h>
+
+#include <list>
+
+
+/**\class ModelAPI_ViewFilter
+* \ingroup DataModel
+* \brief An interface class for filter objects
+*/
+class ModelAPI_Filter
+{
+public:
+ enum ParameterType {
+ NoParameter,
+ RealParameter,
+ ShapeParameter,
+ ObjectParameter
+ };
+
+ /// Returns name of the filter to represent it in GUI
+ virtual std::string name() const = 0;
+
+ /// Returns true if the given shape is accepted by filter
+ /// \param theShape the given shape
+ virtual bool isOk(const GeomShapePtr& theShape) const = 0;
+
+ /// Returns list of supported types of shapes (see GeomAPI_Shape::ShapeType)
+ virtual std::list<int> shapeTypes() const = 0;
+
+ // Returns type of used parameter
+ virtual ParameterType parameterType() const { return NoParameter; }
+
+ /// Set double parameter for the filter
+ virtual void setParameter(double theParam) {}
+
+ /// Set shape parameter for the filter
+ virtual void setParameter(const GeomShapePtr& theParam) {}
+
+ /// Set object parameter for the filter
+ virtual void setParameter(const ObjectPtr& theParam) {}
+
+ /// Returns object parameter
+ virtual ObjectPtr objectParameter() const { return ObjectPtr(); }
+
+ /// Returns shape parameter
+ virtual GeomShapePtr shapeParameter() const { return GeomShapePtr(); }
+
+ /// Returns real parameter
+ virtual double realParameter() const { return 0; }
+
+ /// Returns shape parameter type. Types from GeomAPI_Shape have to be used.
+ /// A type GeomAPI_Shape::SHAPE means any shape
+ virtual int shapeParameterType() const { return GeomAPI_Shape::SHAPE; }
+};
+
+typedef std::shared_ptr<ModelAPI_Filter> FilterPtr;
+
+
+/**\class ModelAPI_ValidatorsFactory
+* \ingroup DataModel
+* \brief Manages registering of filters
+*/
+class ModelAPI_FiltersFactory
+{
+public:
+ /// Register an instance of a filter
+ /// \param theID
+ virtual void registerFilter(const std::string& theID, ModelAPI_Filter* theFilter) = 0;
+
+ /// Returns list of filters for the given shape type
+ /// \param theType a shape type
+ virtual std::list<FilterPtr> filtersForShapeType(GeomAPI_Shape::ShapeType theType) = 0;
+
+protected:
+ /// Get instance from Session
+ ModelAPI_FiltersFactory() {}
+};
+
+typedef std::shared_ptr<ModelAPI_FiltersFactory> FilterFactoryPtr;
+
+#endif
\ No newline at end of file
+++ /dev/null
-// Copyright (C) 2014-2017 CEA/DEN, EDF 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, or (at your option) any later version.
-//
-// 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/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
-//
-
-#ifndef ModelAPI_ViewFilter_H_
-#define ModelAPI_ViewFilter_H_
-
-#include "ModelAPI.h"
-
-#include <GeomAPI_Shape.h>
-
-#include <list>
-
-
-/**\class ModelAPI_ViewFilter
-* \ingroup DataModel
-* \brief An interface class for parameters of filters definition
-*/
-class ModelAPI_FilterParameter
-{
-public:
- virtual ~ModelAPI_FilterParameter() {}
-};
-
-typedef std::shared_ptr<ModelAPI_FilterParameter> FilterParamPtr;
-
-/**\class ModelAPI_ViewFilter
-* \ingroup DataModel
-* \brief An interface class for filter objects
-*/
-class ModelAPI_ViewFilter
-{
-public:
-
- /// Returns true if the given shape is accepted by filter
- /// \param theShape the given shape
- virtual bool isOk(const GeomShapePtr& theShape) const = 0;
-
- /// Returns list of supported types of shapes (see GeomAPI_Shape::ShapeType)
- virtual std::list<int> shapeTypes() const = 0;
-
- /// Set parameter for the filter
- virtual void setParameter(const FilterParamPtr& theParam) {}
-
- /// Returns name of the filter to represent it in GUI
- virtual std::string name() const = 0;
-};
-
-typedef std::shared_ptr<ModelAPI_ViewFilter> FilterPtr;
-
-
-/**\class ModelAPI_ValidatorsFactory
-* \ingroup DataModel
-* \brief Manages registering of filters
-*/
-class ModelAPI_FiltersFactory
-{
-public:
- /// Register an instance of a filter
- /// \param theID
- virtual void registerFilter(const std::string& theID, ModelAPI_ViewFilter* theFilter) = 0;
-
- /// Returns list of filters for the given shape type
- /// \param theType a shape type
- virtual std::list<FilterPtr> filtersForShapeType(GeomAPI_Shape::ShapeType theType) = 0;
-
-protected:
- /// Get instance from Session
- ModelAPI_FiltersFactory() {}
-};
-
-typedef std::shared_ptr<ModelAPI_FiltersFactory> FilterFactoryPtr;
-
-#endif
\ No newline at end of file
#include "ModuleBase_PageWidget.h"
#include "ModuleBase_WidgetSelector.h"
+#include <ModelAPI_Session.h>
+
#include <QLayout>
#include <QPushButton>
#include <QLabel>
#include <QComboBox>
#include <QGroupBox>
#include <QDialog>
+#include <QToolButton>
static int SelectionType = 0;
myShapeType = GeomAPI_Shape::SHAPE;
}
+//*****************************************************************************
+//*****************************************************************************
+//*****************************************************************************
+ModuleBase_FilterItem::ModuleBase_FilterItem(const FilterPtr& theFilter, QWidget* theParent)
+ : QWidget(theParent), myFilter(theFilter)
+{
+ QHBoxLayout* aLayout = new QHBoxLayout(this);
+ aLayout->setContentsMargins(0, 0, 0, 0);
+
+ // Reverse filter button
+ myRevBtn = new QToolButton(this);
+ myRevBtn->setCheckable(true);
+ myRevBtn->setChecked(false);
+ myRevBtn->setAutoRaise(true);
+ myRevBtn->setIcon(QIcon(":pictures/accept.png"));
+ connect(myRevBtn, SIGNAL(toggled(bool)), SLOT(onReverse(bool)));
+ aLayout->addWidget(myRevBtn);
+
+ aLayout->addWidget(new QLabel(myFilter->name().c_str(), this), 1);
+
+ QToolButton* aDelBtn = new QToolButton(this);
+ aDelBtn->setIcon(QIcon(":pictures/button_cancel.png"));
+ aDelBtn->setAutoRaise(true);
+ connect(aDelBtn, SIGNAL(clicked(bool)), SLOT(onDelete()));
+ aLayout->addWidget(aDelBtn);
+}
+
+
+void ModuleBase_FilterItem::onReverse(bool theCheck)
+{
+ if (theCheck)
+ myRevBtn->setIcon(QIcon(":pictures/stop.png"));
+ else
+ myRevBtn->setIcon(QIcon(":pictures/accept.png"));
+}
+
+void ModuleBase_FilterItem::onDelete()
+{
+ emit deleteItem(this);
+}
+
//*****************************************************************************
//*****************************************************************************
ModuleBase_Tools::adjustMargins(aMainLayout);
myFiltersGroup = new QGroupBox(tr("Dynamic Filters"), this);
- QVBoxLayout* aGroupLayout = new QVBoxLayout(myFiltersGroup);
+ myGroupLayout = new QVBoxLayout(myFiltersGroup);
+ myGroupLayout->setContentsMargins(0, 0, 0, 0);
+ myGroupLayout->setSpacing(0);
QWidget* aFiltersWgt = new QWidget(myFiltersGroup);
QHBoxLayout* aFiltersLay = new QHBoxLayout(aFiltersWgt);
+ ModuleBase_Tools::adjustMargins(aFiltersLay);
QLabel* aFilterLbl = new QLabel(aFiltersWgt);
aFilterLbl->setPixmap(QPixmap(":pictures/filter.png"));
myFiltersCombo = new QComboBox(aFiltersWgt);
-
- QPushButton* aAddBtn = new QPushButton(tr("Add"), aFiltersWgt);
- connect(aAddBtn, SIGNAL(clicked()), SLOT(onAddFilter()));
+ SessionPtr aSession = ModelAPI_Session::get();
+ myFilters =
+ aSession->filters()->filtersForShapeType((GeomAPI_Shape::ShapeType) mySelectionType);
+ QStringList aItems;
+ std::list<FilterPtr>::const_iterator aIt;
+ for (aIt = myFilters.cbegin(); aIt != myFilters.cend(); aIt++)
+ aItems.push_back((*aIt)->name().c_str());
+ myFiltersCombo->addItems(aItems);
+
+ QToolButton* aAddBtn = new QToolButton(aFiltersWgt);
+ aAddBtn->setIcon(QIcon(":pictures/add.png"));
+ aAddBtn->setAutoRaise(true);
+ aAddBtn->setToolTip(tr("Add current filter"));
+ connect(aAddBtn, SIGNAL(clicked()), SLOT(onAddItem()));
aFiltersLay->addWidget(aFilterLbl);
- aFiltersLay->addWidget(myFiltersCombo);
+ aFiltersLay->addWidget(myFiltersCombo, 1);
aFiltersLay->addWidget(aAddBtn);
- aGroupLayout->addWidget(aFiltersWgt);
+ myGroupLayout->addWidget(aFiltersWgt);
aMainLayout->addWidget(myFiltersGroup);
+
+ QWidget* aBtnWgt = new QWidget(this);
+ QHBoxLayout* aBtnLayout = new QHBoxLayout(aBtnWgt);
+ ModuleBase_Tools::adjustMargins(aBtnLayout);
+
+ aBtnLayout->addStretch(1);
+
+ QPushButton* aSelectBtn = new QPushButton(tr("Select"), aBtnWgt);
+ connect(aSelectBtn, SIGNAL(clicked()), SLOT(onSelect()));
+ aBtnLayout->addWidget(aSelectBtn);
+
+ aMainLayout->addWidget(aBtnWgt);
+
aMainLayout->addStretch(1);
}
-void ModuleBase_WidgetSelectionFilter::onAddFilter()
+void ModuleBase_WidgetSelectionFilter::onAddItem()
+{
+ int aId = myFiltersCombo->currentIndex();
+ myFiltersCombo->removeItem(aId);
+
+ std::list<FilterPtr>::iterator aIt;
+ int i;
+ FilterPtr aFilter;
+ for (aIt = myFilters.begin(), i = 0; aIt != myFilters.cend(); i++, aIt++) {
+ if (i == aId) {
+ aFilter = (*aIt);
+ myFilters.erase(aIt);
+ break;
+ }
+ }
+ if (aFilter.get()) {
+ myUseFilters.push_back(aFilter);
+ ModuleBase_FilterItem* aItem = new ModuleBase_FilterItem(aFilter, myFiltersGroup);
+ connect(aItem, SIGNAL(deleteItem(ModuleBase_FilterItem*)),
+ SLOT(onDeleteItem(ModuleBase_FilterItem*)));
+ myGroupLayout->addWidget(aItem);
+ }
+}
+
+void ModuleBase_WidgetSelectionFilter::onDeleteItem(ModuleBase_FilterItem* theItem)
+{
+ FilterPtr aFilter = theItem->filter();
+ myGroupLayout->removeWidget(theItem);
+ theItem->deleteLater();
+
+ myUseFilters.remove(aFilter);
+ myFilters.push_back(aFilter);
+ myFiltersCombo->addItem(aFilter->name().c_str());
+}
+
+void ModuleBase_WidgetSelectionFilter::onSelect()
{
}
#include "ModuleBase.h"
#include "ModuleBase_ModelWidget.h"
+#include <ModelAPI_Filter.h>
#include <QWidget>
class QLabel;
class QComboBox;
class QGroupBox;
+class QToolButton;
+class QVBoxLayout;
+
class ModuleBase_IWorkshop;
class MODULEBASE_EXPORT ModuleBase_FilterStarter: public QWidget
};
+class ModuleBase_FilterItem : public QWidget
+{
+ Q_OBJECT
+public:
+ ModuleBase_FilterItem(const FilterPtr& theFilter, QWidget* theParent);
+
+ FilterPtr filter() const { return myFilter; }
+
+signals:
+ void deleteItem(ModuleBase_FilterItem* theItem);
+
+ private slots:
+ void onReverse(bool theCheck);
+ void onDelete();
+
+private:
+ FilterPtr myFilter;
+ QToolButton* myRevBtn;
+};
+
class ModuleBase_WidgetSelectionFilter : public ModuleBase_ModelWidget
{
Q_OBJECT
virtual bool restoreValueCustom() { return true; }
private slots:
- void onAddFilter();
+ void onAddItem();
+ void onDeleteItem(ModuleBase_FilterItem* theItem);
+ void onSelect();
private:
ModuleBase_IWorkshop* myWorkshop;
QComboBox* myFiltersCombo;
QGroupBox* myFiltersGroup;
+ QVBoxLayout* myGroupLayout;
int mySelectionType;
+ std::list<FilterPtr> myFilters;
+ std::list<FilterPtr> myUseFilters;
};
+
#endif
\ No newline at end of file
+++ /dev/null
-## Copyright (C) 2014-2017 CEA/DEN, EDF 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, or (at your option) any later version.
-##
-## 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/ or
-## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
-##
-
-INCLUDE(Common)
-
-SET(PROJECT_HEADERS
- ViewFilters.h
- ViewFilters_Plugin.h
- ViewFilters_HorizontalPlane.h
- ViewFilters_VerticalPlane.h
-)
-
-SET(PROJECT_SOURCES
- ViewFilters_Plugin.cpp
- ViewFilters_HorizontalPlane.cpp
- ViewFilters_VerticalPlane.cpp
-)
-
-SET(PROJECT_LIBRARIES
- ModelAPI
- Events
- Config
- GeomAPI
-)
-
-ADD_DEFINITIONS(-DVIEWFILTERS_EXPORTS ${OpenCASCADE_DEFINITIONS})
-ADD_LIBRARY(ViewFilters SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
-TARGET_LINK_LIBRARIES(ViewFilters ${PROJECT_LIBRARIES})
-
-INCLUDE_DIRECTORIES(
- ${OpenCASCADE_INCLUDE_DIR}
- ${PROJECT_SOURCE_DIR}/src/ModelAPI
- ${PROJECT_SOURCE_DIR}/src/Config
- ${PROJECT_SOURCE_DIR}/src/Events
- ${PROJECT_SOURCE_DIR}/src/GeomAPI
- ${PROJECT_SOURCE_DIR}/src/GeomDataAPI
-)
-
-INSTALL(TARGETS ViewFilters DESTINATION ${SHAPER_INSTALL_PLUGIN_FILES})
+++ /dev/null
-// Copyright (C) 2014-2017 CEA/DEN, EDF 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, or (at your option) any later version.
-//
-// 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/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
-//
-
-#ifndef VIEWFILTERS_H
-#define VIEWFILTERS_H
-
-#if defined VIEWFILTERS_EXPORTS
-#if defined WIN32
-#define VIEWFILTERS_EXPORT __declspec( dllexport )
-#else
-#define VIEWFILTERS_EXPORT
-#endif
-#else
-#if defined WIN32
-#define VIEWFILTERS_EXPORT __declspec( dllimport )
-#else
-#define VIEWFILTERS_EXPORT
-#endif
-#endif
-
-#endif
+++ /dev/null
-// Copyright (C) 2014-2017 CEA/DEN, EDF 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, or (at your option) any later version.
-//
-// 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/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
-//
-
-#include "ViewFilters_HorizontalPlane.h"
-
-#include <GeomAPI_Face.h>
-#include <GeomAPI_Pln.h>
-
-bool ViewFilters_HorizontalPlane::isOk(const GeomShapePtr& theShape) const
-{
- if (!theShape->isFace())
- return false;
-
- if (!theShape->isPlanar())
- return false;
- GeomFacePtr aFace = std::dynamic_pointer_cast<GeomAPI_Face>(theShape);
-
- GeomPlanePtr aPlane = aFace->getPlane();
- GeomDirPtr aDir = aPlane->direction();
- if (aDir->isParallel(GeomDirPtr(new GeomAPI_Dir(0,0,1))))
- return true;
- return false;
-}
-
-std::list<int> ViewFilters_HorizontalPlane::shapeTypes() const
-{
- std::list<int> aList;
- aList.push_back(GeomAPI_Shape::FACE);
- return aList;
-}
+++ /dev/null
-// Copyright (C) 2014-2017 CEA/DEN, EDF 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, or (at your option) any later version.
-//
-// 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/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
-//
-
-#ifndef VIEWFILTERS_HORIZONTALPLANE_H_
-#define VIEWFILTERS_HORIZONTALPLANE_H_
-
-#include "ViewFilters.h"
-
-#include <ModelAPI_ViewFilter.h>
-
-class ViewFilters_HorizontalPlane : public ModelAPI_ViewFilter
-{
-public:
- virtual bool isOk(const GeomShapePtr& theShape) const;
-
- /// Returns list of supported types of shapes (see GeomAPI_Shape::ShapeType)
- virtual std::list<int> shapeTypes() const;
-
- /// Returns name of the filter to represent it in GUI
- virtual std::string name() const { return "Horizontal faces"; }
-};
-
-
-#endif
\ No newline at end of file
+++ /dev/null
-// Copyright (C) 2014-2017 CEA/DEN, EDF 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, or (at your option) any later version.
-//
-// 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/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
-//
-
-#include "ViewFilters_Plugin.h"
-#include "ViewFilters_HorizontalPlane.h"
-#include "ViewFilters_VerticalPlane.h"
-
-#include <ModelAPI_Session.h>
-#include <ModelAPI_ViewFilter.h>
-
-// the only created instance of this plugin
-static ViewFilters_Plugin* MY_VIEWFILTERS_INSTANCE = new ViewFilters_Plugin();
-
-ViewFilters_Plugin::ViewFilters_Plugin()
-{
- // register validators
- SessionPtr aMgr = ModelAPI_Session::get();
- ModelAPI_FiltersFactory* aFactory = aMgr->filters();
- aFactory->registerFilter("HorizontalFaces", new ViewFilters_HorizontalPlane);
- aFactory->registerFilter("VerticalFaces", new ViewFilters_VerticalPlane);
-
- // register this plugin
- ModelAPI_Session::get()->registerPlugin(this);
-}
-
-FeaturePtr ViewFilters_Plugin::createFeature(std::string theFeatureID)
-{
- // feature of such kind is not found
- return FeaturePtr();
-}
+++ /dev/null
-// Copyright (C) 2014-2017 CEA/DEN, EDF 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, or (at your option) any later version.
-//
-// 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/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
-//
-
-#ifndef VIEWFILTERS_PLUGIN_H_
-#define VIEWFILTERS_PLUGIN_H_
-
-#include "ViewFilters.h"
-#include <ModelAPI_Plugin.h>
-#include <ModelAPI_Feature.h>
-
-/**\class GeomValidators_Plugin
- * \ingroup Plugins
- * \brief Interface common for any plugin: allows to use plugin by the plugins manager.
- */
-class VIEWFILTERS_EXPORT ViewFilters_Plugin : public ModelAPI_Plugin
-{
-public:
- /// Creates the feature object of this plugin by the feature string ID
- virtual FeaturePtr createFeature(std::string theFeatureID);
-
-public:
- ViewFilters_Plugin();
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2014-2017 CEA/DEN, EDF 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, or (at your option) any later version.
-//
-// 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/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
-//
-
-#include "ViewFilters_VerticalPlane.h"
-
-#include <GeomAPI_Face.h>
-#include <GeomAPI_Pln.h>
-
-bool ViewFilters_VerticalPlane::isOk(const GeomShapePtr& theShape) const
-{
- if (!theShape->isFace())
- return false;
-
- if (!theShape->isPlanar())
- return false;
- GeomFacePtr aFace = std::dynamic_pointer_cast<GeomAPI_Face>(theShape);
-
- GeomPlanePtr aPlane = aFace->getPlane();
- GeomDirPtr aDir = aPlane->direction();
- if (aDir->z() <= 1.e-7)
- return true;
- return false;
-}
-
-std::list<int> ViewFilters_VerticalPlane::shapeTypes() const
-{
- std::list<int> aList;
- aList.push_back(GeomAPI_Shape::FACE);
- return aList;
-}
+++ /dev/null
-// Copyright (C) 2014-2017 CEA/DEN, EDF 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, or (at your option) any later version.
-//
-// 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/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
-//
-
-#ifndef VIEWFILTERS_VERTICALPLANE_H_
-#define VIEWFILTERS_VERTICALPLANE_H_
-
-#include "ViewFilters.h"
-
-#include <ModelAPI_ViewFilter.h>
-
-class ViewFilters_VerticalPlane : public ModelAPI_ViewFilter
-{
-public:
- virtual bool isOk(const GeomShapePtr& theShape) const;
-
- /// Returns list of supported types of shapes (see GeomAPI_Shape::ShapeType)
- virtual std::list<int> shapeTypes() const;
-
- /// Returns name of the filter to represent it in GUI
- virtual std::string name() const { return "Vertical faces"; }
-};
-
-
-#endif
\ No newline at end of file
<file>pictures/filter.png</file>
<file>pictures/plus_minus.png</file>
+ <file>pictures/add.png</file>
+ <file>pictures/accept.png</file>
+ <file>pictures/stop.png</file>
</qresource>
</RCC>