Salome HOME
Merge branch 'Dev_1.1.0' of newgeom:newgeom into Dev_1.1.0
[modules/shaper.git] / src / Model / Model_ResultConstruction.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        ModelAPI_ResultConstruction.cpp
4 // Created:     07 Jul 2014
5 // Author:      Mikhail PONIKAROV
6
7 #include <Model_ResultConstruction.h>
8
9 #include <ModelAPI_AttributeIntArray.h>
10 #include <Config_PropManager.h>
11
12 void Model_ResultConstruction::initAttributes()
13 {
14   // append the color attribute
15   DataPtr aData = data();
16   aData->addAttribute(COLOR_ID(), ModelAPI_AttributeIntArray::type());
17   AttributeIntArrayPtr aColorAttr = aData->intArray(COLOR_ID());
18   std::vector<int> aRGB;
19   aRGB = Config_PropManager::color("Visualization", "result_construction_color", DEFAULT_COLOR());
20   aColorAttr->setSize(3);
21   aColorAttr->setValue(0, aRGB[0]);
22   aColorAttr->setValue(1, aRGB[1]);
23   aColorAttr->setValue(2, aRGB[2]);
24 }
25
26 void Model_ResultConstruction::setShape(std::shared_ptr<GeomAPI_Shape> theShape)
27 {
28   myShape = theShape;
29 }
30
31 std::shared_ptr<GeomAPI_Shape> Model_ResultConstruction::shape()
32 {
33   return myShape;
34 }
35
36 Model_ResultConstruction::Model_ResultConstruction()
37 {
38   myIsInHistory = true;
39   setIsConcealed(false);
40 }
41
42 void Model_ResultConstruction::setIsInHistory(const bool isInHistory)
43 {
44   myIsInHistory = isInHistory;
45 }