1 // Created on: 2011-10-14
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.
19 #include <IVtk_Types.hxx>
21 #if defined(_WIN32) && !defined(HAVE_NO_DLL)
22 #ifdef __IVtkTools_DLL
23 #define IVtkTools_EXPORT __declspec( dllexport )
25 #define IVtkTools_EXPORT __declspec( dllimport )
28 #define IVtkTools_EXPORT
34 //! Helper methods to facilitate usage of VIS classes in an application.
38 //! Returns vtkLookupTable instance initialized by standrad OCCT colors used
39 //! in wireframe mode for different kinds of sub-shapes (free/boundary/shared
40 //! edges, isolines,...)
41 Standard_EXPORT vtkLookupTable* InitLookupTable();
43 //! Set a color for given type of sub-shapes.
44 //! @param [in,out] theColorTable vtkLookupTable to set the color.
45 //! @param [in] theColorRole type of sub-shapes to set the color.
46 //! @param [in] theR red color component. Use [0,1] double values.
47 //! @param [in] theG green color component. Use [0,1] double values.
48 //! @param [in] theB blue color component. Use [0,1] double values.
49 //! @param [in] theA the alpha value (the opacity) as a double between 0 and 1.
50 Standard_EXPORT void SetLookupTableColor (vtkLookupTable* theColorTable,
51 const IVtk_MeshType theColorRole,
52 const double theR, const double theG, const double theB,
53 const double theA = 1);
55 //! Get a color for given type of sub-shapes.
56 //! @param [in] theColorTable vtkLookupTable to set the color.
57 //! @param [in] theColorRole type of sub-shapes to set the color.
58 //! @param [out] theR red color component as a double between 0 and 1.
59 //! @param [out] theG green color component as a double between 0 and 1.
60 //! @param [out] theB blue color component as a double between 0 and 1.
61 Standard_EXPORT void GetLookupTableColor (vtkLookupTable* theColorTable,
62 const IVtk_MeshType theColorRole,
63 double &theR, double &theG, double &theB);
65 //! Get a color for given type of sub-shapes.
66 //! @param [in] theColorTable vtkLookupTable to set the color.
67 //! @param [in] theColorRole type of sub-shapes to set the color.
68 //! @param [out] theR red color component as a double between 0 and 1.
69 //! @param [out] theG green color component as a double between 0 and 1.
70 //! @param [out] theB blue color component as a double between 0 and 1.
71 //! @param [out] theA the alpha value (the opacity) as a double between 0 and 1.
72 Standard_EXPORT void GetLookupTableColor (vtkLookupTable* theColorTable,
73 const IVtk_MeshType theColorRole,
74 double &theR, double &theG, double &theB,
77 //! Set up the initial shape mapper parameters with default OCC colors.
78 Standard_EXPORT void InitShapeMapper (vtkMapper* theMapper);
80 //! Set up the initial shape mapper parameters with user colors.
81 //! @param [in,out] theMapper mapper to initialize
82 //! @param [in] theColorTable a table with user's colors definition
83 Standard_EXPORT void InitShapeMapper (vtkMapper* theMapper,
84 vtkLookupTable* theColorTable);