MantisBT - Open CASCADE
View Issue Details
0022854Open CASCADE[OCCT] OCCT:VISpublic2011-12-16 14:262014-11-11 12:58
san 
bugmaster 
normalminor 
closedfixed 
ALL
 
[OCCT] 6.8.0[OCCT] 6.8.0 
Not needed
0022854: Helper methods in IVtkTools package
IVtkTools package lacks the following helper methods that should facilitate usage of VIS classes in an application:

1. InitLookupTable() - should return vtkLookupTable instance initialized by standrad OCCT colors used in wireframe mode for different kinds of sub-shapes (free/boundary/shared edges, isolines,...)
2. SetLookupTableColor( vtkLookupTable*, color_role, color ), GetLookupTableColor( vtkLookupTable*, color_role ) - methods to get/modify colors for given type of sub-shapes.
3. InitShapeMapper() - a method to set up the initial shape mapper parameters
4. Maybe, some method to set up the shape actor and/or mapper according to the current display mode.
No tags attached.
related to 0024904closed bugmaster Visualization - Integration of VIS component 
Issue History
2011-12-16 14:26sanNew Issue
2011-12-16 14:26sanAssigned To => rkv
2011-12-16 14:27sanStatusnew => assigned
2011-12-20 12:49rkvNote Added: 0018918
2011-12-20 12:49rkvAssigned Torkv => san
2011-12-20 12:49rkvStatusassigned => feedback
2011-12-21 10:23rkvNote Added: 0018930
2011-12-21 10:24rkvAssigned Tosan => rkv
2011-12-21 10:24rkvStatusfeedback => resolved
2011-12-21 10:24rkvDescription Updatedbug_revision_view_page.php?rev_id=1316#r1316
2011-12-26 07:39abvProjectOpen CASCADE => Internal
2012-05-12 17:36mkvAssigned Torkv => san
2012-08-18 14:38sanNote Added: 0021265
2012-08-18 14:38sanAssigned Tosan => bugmaster
2012-08-18 14:38sanStatusresolved => reviewed
2014-09-18 09:50abvTarget Version => 6.8.0
2014-09-18 09:58abvCategoryPRODUCTS:VIS => OCCT:VIS
2014-09-18 10:39bugmasterProjectInternal => Open CASCADE
2014-09-22 11:36apnTest case number => Not needed
2014-09-22 11:36apnAssigned Tobugmaster => san
2014-09-22 11:36apnStatusreviewed => closed
2014-09-22 11:36apnResolutionopen => fixed
2014-09-22 13:12apnAssigned Tosan => bugmaster
2014-09-22 13:12apnStatusclosed => feedback
2014-09-22 13:12apnStatusfeedback => tested
2014-09-22 13:13apnStatustested => verified
2014-09-22 13:13apnRelationship addedrelated to 0024904
2014-11-11 12:45aivFixed in Version => 6.8.0
2014-11-11 12:58aivStatusverified => closed

Notes
(0018918)
rkv   
2011-12-20 12:49   
I'd suggest the following methods in IVtkTools namespace:

namespace IVtkTools {
//! Returns vtkLookupTable instance initialized by standrad OCCT colors used
//! in wireframe mode for different kinds of sub-shapes (free/boundary/shared
//! edges, isolines,...)
IVtkTools_EXPORTS vtkLookupTable* InitLookupTable();

//! Set a color for given type of sub-shapes.
IVtkTools_EXPORTS SetLookupTableColor (vtkLookupTable* lut,
                                       const IVtk_MeshType colorRole,
                                       const double r, const double g, const double b,
                                       const double a = 1);

//! Get a color for given type of sub-shapes.
IVtkTools_EXPORTS GetLookupTableColor (vtkLookupTable* lut,
                                       const IVtk_MeshType colorRole,
                                       double &r, double &g, double &b);

//! Get a color for given type of sub-shapes.
IVtkTools_EXPORTS GetLookupTableColor (vtkLookupTable* lut,
                                       const IVtk_MeshType colorRole,
                                       double &r, double &g, double &b,
                                       double &a);

//! Set up the initial shape mapper parameters.
IVtkTools_EXPORTS InitShapeMapper (vtkMapper* aMapper);
}
(0018930)
rkv   
2011-12-21 10:23   
Following methods are implemented:
namespace IVtkTools {
//! Returns vtkLookupTable instance initialized by standrad OCCT colors used
//! in wireframe mode for different kinds of sub-shapes (free/boundary/shared
//! edges, isolines,...)
vtkLookupTable* InitLookupTable();

//! Set a color for given type of sub-shapes.
//! @param [in,out] aColorTable vtkLookupTable to set the color.
//! @param [in] colorRole type of sub-shapes to set the color.
//! @param [in] r red color component. Use [0,1] double values.
//! @param [in] g green color component. Use [0,1] double values.
//! @param [in] b blue color component. Use [0,1] double values.
//! @param [in] a the alpha value (the opacity) as a double between 0 and 1.
void SetLookupTableColor (vtkLookupTable* aColorTable,
                                       const IVtk_MeshType colorRole,
                                       const double r, const double g, const double b,
                                       const double a = 1);

//! Get a color for given type of sub-shapes.
//! @param [in] aColorTable vtkLookupTable to set the color.
//! @param [in] colorRole type of sub-shapes to set the color.
//! @param [out] r red color component as a double between 0 and 1.
//! @param [out] g green color component as a double between 0 and 1.
//! @param [out] b blue color component as a double between 0 and 1.
void GetLookupTableColor (vtkLookupTable* aColorTable,
                                       const IVtk_MeshType colorRole,
                                       double &r, double &g, double &b);

//! Get a color for given type of sub-shapes.
//! @param [in] aColorTable vtkLookupTable to set the color.
//! @param [in] colorRole type of sub-shapes to set the color.
//! @param [out] r red color component as a double between 0 and 1.
//! @param [out] g green color component as a double between 0 and 1.
//! @param [out] b blue color component as a double between 0 and 1.
//! @param [out] a the alpha value (the opacity) as a double between 0 and 1.
void GetLookupTableColor (vtkLookupTable* aColorTable,
                                       const IVtk_MeshType colorRole,
                                       double &r, double &g, double &b,
                                       double &a);

//! Set up the initial shape mapper parameters with default OCC colors.
void InitShapeMapper (vtkMapper* aMapper);

//! Set up the initial shape mapper parameters with user colors.
//! @param [in,out] aMapper mapper to initialize
//! @param [in] aColorTable a table with user's colors definition
void InitShapeMapper (vtkMapper* aMapper,
                                       vtkLookupTable* aColorTable);
}
(0021265)
san   
2012-08-18 14:38   
The issue has been corrected and should be closed, no testing is required.