1 // Created on: 2011-11-15
2 // Created by: Roman KOZLOV
3 // Copyright (c) 2011-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef IVtkTOOLS_DISPLAYMODEFILTER_H
17 #define IVtkTOOLS_DISPLAYMODEFILTER_H
19 #include <IVtkTools.hxx>
20 #include <IVtkTools_SubPolyDataFilter.hxx>
21 #include <NCollection_DataMap.hxx>
25 #pragma warning(disable: 4251) // avoid warning C4251: "class needs to have dll-interface..."
28 //! @class IVtkTools_DisplayModeFilter
29 //! @brief Cells filter according to the selected display mode by mesh parts types.
30 //! This filter is used to get parts of a shape according to different
32 class Standard_EXPORT IVtkTools_DisplayModeFilter : public IVtkTools_SubPolyDataFilter
35 vtkTypeMacro(IVtkTools_DisplayModeFilter,IVtkTools_SubPolyDataFilter)
37 static IVtkTools_DisplayModeFilter *New();
38 void PrintSelf (std::ostream& os, vtkIndent indent);
40 //! Set display mode to define cells types to be passed through this filter.
41 void SetDisplayMode (const IVtk_DisplayMode aMode);
43 //! Display or not shared vertices.
44 void SetDisplaySharedVertices (const bool doDisplay);
46 //! Get current display mode.
47 IVtk_DisplayMode GetDisplayMode() const;
49 //! Returns list of displaying mesh element types for the given display mode
50 const IVtk_IdTypeMap& MeshTypesForMode(IVtk_DisplayMode theMode) const;
52 //! Set a list of displaying mesh element types for the given display mode
53 void SetMeshTypesForMode(IVtk_DisplayMode theMode, const IVtk_IdTypeMap& theMeshTypes);
55 //! Draw Boundary of faces for shading mode
56 void SetFaceBoundaryDraw(bool theToDraw);
58 //! Returns True if drawing Boundary of faces for shading mode is defined.
59 bool FaceBoundaryDraw() const { return myDrawFaceBoundaries; }
62 //! Filter cells according to the given set of ids.
63 virtual int RequestData (vtkInformation *, vtkInformationVector **, vtkInformationVector *);
65 IVtkTools_DisplayModeFilter();
66 virtual ~IVtkTools_DisplayModeFilter();
69 //! Display mode defining mesh types to pass through this filter.
70 IVtk_DisplayMode myDisplayMode;
71 IVtk_IdTypeMap myModesDefinition[2];
72 bool myDoDisplaySharedVertices;
74 //! Draw Face boundaries flag is applicable only for shading display mode.
75 bool myDrawFaceBoundaries;
82 #endif // IVtkTOOLS_DISPLAYMODEFILTER_H