913a4c4a |
1 | // Created on: 2011-11-15 |
2 | // Created by: Roman KOZLOV |
3 | // Copyright (c) 2011-2014 OPEN CASCADE SAS |
4 | // |
5 | // This file is part of Open CASCADE Technology software library. |
6 | // |
09711f37 |
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 |
913a4c4a |
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. |
12 | // |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
15 | |
16 | #ifndef IVtkTOOLS_DISPLAYMODEFILTER_H |
17 | #define IVtkTOOLS_DISPLAYMODEFILTER_H |
18 | |
19 | #include <IVtkTools.hxx> |
20 | #include <IVtkTools_SubPolyDataFilter.hxx> |
913a4c4a |
21 | #include <NCollection_DataMap.hxx> |
22 | |
896faa72 |
23 | #ifdef _MSC_VER |
24 | #pragma warning(push) |
25 | #pragma warning(disable: 4251) // avoid warning C4251: "class needs to have dll-interface..." |
26 | #endif |
27 | |
913a4c4a |
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 |
31 | //! display modes. |
32 | class Standard_EXPORT IVtkTools_DisplayModeFilter : public IVtkTools_SubPolyDataFilter |
33 | { |
34 | public: |
68858c7d |
35 | vtkTypeMacro(IVtkTools_DisplayModeFilter,IVtkTools_SubPolyDataFilter) |
36 | |
913a4c4a |
37 | static IVtkTools_DisplayModeFilter *New(); |
38 | void PrintSelf (std::ostream& os, vtkIndent indent); |
39 | |
40 | //! Set display mode to define cells types to be passed through this filter. |
41 | void SetDisplayMode (const IVtk_DisplayMode aMode); |
42 | |
43 | //! Display or not shared vertices. |
44 | void SetDisplaySharedVertices (const bool doDisplay); |
45 | |
46 | //! Get current display mode. |
c7854818 |
47 | IVtk_DisplayMode GetDisplayMode() const; |
913a4c4a |
48 | |
4db6748c |
49 | //! Returns list of displaying mesh element types for the given display mode |
50 | const IVtk_IdTypeMap& MeshTypesForMode(IVtk_DisplayMode theMode) const; |
51 | |
52 | //! Set a list of displaying mesh element types for the given display mode |
53 | void SetMeshTypesForMode(IVtk_DisplayMode theMode, const IVtk_IdTypeMap& theMeshTypes); |
54 | |
55 | //! Draw Boundary of faces for shading mode |
56 | void SetFaceBoundaryDraw(bool theToDraw); |
57 | |
58 | //! Returns True if drawing Boundary of faces for shading mode is defined. |
59 | bool FaceBoundaryDraw() const { return myDrawFaceBoundaries; } |
60 | |
d0b8f010 |
61 | //! Returns TRUE if vertex normals should be included for smooth shading within DM_Shading mode or not. |
62 | bool IsSmoothShading() const { return myIsSmoothShading; } |
63 | |
64 | //! Set if vertex normals should be included for smooth shading or not. |
65 | void SetSmoothShading (bool theIsSmooth); |
66 | |
913a4c4a |
67 | protected: |
68 | //! Filter cells according to the given set of ids. |
3483c644 |
69 | virtual int RequestData (vtkInformation *, vtkInformationVector **, vtkInformationVector *) Standard_OVERRIDE; |
913a4c4a |
70 | |
71 | IVtkTools_DisplayModeFilter(); |
a2f76b15 |
72 | virtual ~IVtkTools_DisplayModeFilter(); |
913a4c4a |
73 | |
74 | protected: |
d0b8f010 |
75 | IVtk_DisplayMode myDisplayMode; //!< Display mode defining mesh types to pass through this filter |
4db6748c |
76 | IVtk_IdTypeMap myModesDefinition[2]; |
77 | bool myDoDisplaySharedVertices; |
78 | |
d0b8f010 |
79 | bool myDrawFaceBoundaries; //!< Draw Face boundaries within shading display mode |
80 | bool myIsSmoothShading; //!< include vertex normals for smooth shading or not |
913a4c4a |
81 | }; |
82 | |
896faa72 |
83 | #ifdef _MSC_VER |
84 | #pragma warning(pop) |
85 | #endif |
86 | |
913a4c4a |
87 | #endif // IVtkTOOLS_DISPLAYMODEFILTER_H |
88 | |