Salome HOME
0ee703e0aa86ce4a900f1b792511fe3f4fd73542
[modules/geom.git] / src / OBJECT / GEOM_Constants.cxx
1 // Copyright (C) 2007-2023  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 //  File   : GEOM_Constants.cxx
24 //  Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
25
26 #include "GEOM_Constants.h"
27
28 #include <limits.h>
29
30 namespace GEOM
31 {
32
33   /*!
34     \brief Get minimal allowed value for deflection coefficient
35   */
36   double minDeflection()
37   {
38     return 1e-06; // DEFLECTION_MIN
39   }
40
41   /*!
42     \brief Get character used to separate parameter names
43   */
44   QString sectionSeparator()
45   {
46     return "_"; // NAME_SEPARATOR
47   }
48
49   /*!
50     \brief Get character used to separate numeric parameter values (color = r:g:b)
51   */
52   QString subSectionSeparator()
53   {
54     return ":"; // DIGIT_SEPARATOR
55   }
56   
57   QString propertyName( Property type )
58   {
59     static const char* names[] = {
60       // visibility 
61       "Visibility",      // VISIBILITY_PROP
62       // transparency
63       "Transparency",    // TRANSPARENCY_PROP
64       // display mode
65       "DisplayMode",     // DISPLAY_MODE_PROP
66       // number of the iso lines (along u and v directions)
67       "Isos",            // ISOS_PROP
68       // main / shading color
69       "Color",           // COLOR_PROP
70       // "show edges direction" flag
71       "VectorMode",      // VECTOR_MODE_PROP
72       // "show vertices" flag
73       "VerticesMode",    // VERTICES_MODE_PROP
74       // "show name" flag
75       "NameMode",        // NAME_MODE_PROP
76       // deflection coefficient
77       "DeflectionCoeff", // DEFLECTION_COEFF_PROP
78       // point marker data
79       "MarkerType",      // MARKER_TYPE_PROP
80       // material
81       "Material",        // MATERIAL_PROP
82       // general line width
83       "EdgeWidth",       // EDGE_WIDTH_PROP
84       // isos width
85       "IsosWidth",       // ISOS_WIDTH_PROP
86       // top-level flag
87       "TopLevelFlag",    // TOP_LEVEL_PROP
88       // opacity
89       "Opacity",         // OPACITY_PROP
90       // shading color
91       "ShadingColor",    // -
92       // wireframe color
93       "WireframeColor",  // -
94       // standalone edges color
95       "LineColor",       // -
96       // free boundaries color
97       "FreeBndColor",    // -
98       // points color
99       "PointColor",      // -
100       // isos color
101       "IsosColor",       // -
102       // outlines color
103       "OutlineColor",    // -
104       // texture
105       "Texture",         // -
106       // dimensions
107       "Dimensions",      // -
108       // shape annotations
109       "ShapeAnnotations" // -
110     };
111     return ( type >= GEOM::Visibility && type <= GEOM::LastProperty ) ? names[type] : QString();
112   }
113
114   /*!
115     \brief Id used for storing properties of objects in study shared between viewers.
116   */
117   int sharedPropertiesId()
118   {
119     return INT_MIN;
120   }
121 } // namespace GEOM