1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: XGUI_CustomPrs.hxx
4 // Created: 10 Mar 2015
5 // Author: Natalia ERMOLAEVA
7 #ifndef XGUI_CustomPrs_H
8 #define XGUI_CustomPrs_H
11 #include <GeomAPI_ICustomPrs.h>
12 #include <GeomAPI_AISObject.h>
13 #include <ModelAPI_Result.h>
18 * Interface of a class which can provide specific customization of
21 class XGUI_CustomPrs : public GeomAPI_ICustomPrs
25 /// \param theWorkshop the current workshop instance
26 XGUI_EXPORT XGUI_CustomPrs(XGUI_Workshop* theWorkshop);
28 XGUI_EXPORT virtual ~XGUI_CustomPrs() {};
30 /// Modifies the given presentation in the custom way.
31 virtual bool customisePresentation(ResultPtr theResult, AISObjectPtr thePrs,
32 std::shared_ptr<GeomAPI_ICustomPrs> theCustomPrs);
34 /// Returns color of a result object
35 /// \param theResult a result object
36 /// \param theColor a color in form of RGB vector
37 static void getResultColor(const ResultPtr& theResult, std::vector<int>& theColor);
39 /// Returns deflection of a result object
40 /// \param theResult a result object
41 /// \return theDeflection a real value
42 static double getResultDeflection(const ResultPtr& theResult);
44 /// Returns the default object color. It obtains colorConfigInfo of the object
45 /// and find it in preferences. If there are no this color in preference and an empty
46 /// color is interpreted as invalid, it shows error message
47 /// \param theObject an investigated object
48 /// \param isEmptyColorValid boolean state about interpretation of empty color
49 /// \param theColor the result color
50 static void XGUI_EXPORT getDefaultColor(ObjectPtr theObject, const bool isEmptyColorValid,
51 std::vector<int>& theColor);
53 /// Returns the default deflection value. The value is obtained from the application preferences
54 /// \param theObject an investigated object
55 /// \return deflection value
56 static double XGUI_EXPORT getDefaultDeflection(const ObjectPtr& theObject);
59 XGUI_Workshop* myWorkshop; ///< the current workshop