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(ResultPtr theResult, std::vector<int>& theColor);
39 /// Returns the default object color. It obtains colorConfigInfo of the object
40 /// and find it in preferences. If there are no this color in preference and an empty
41 /// color is interpreted as invalid, it shows error message
42 /// \param theObject an investigated object
43 /// \param isEmptyColorValid boolean state about interpretation of empty color
44 /// \param theColor the result color
45 static void XGUI_EXPORT getDefaultColor(ObjectPtr theObject, const bool isEmptyColorValid,
46 std::vector<int>& theColor);
50 XGUI_Workshop* myWorkshop; /// the current workshop