Salome HOME
Copyrights update 2015.
[modules/geom.git] / src / OBJECT / GEOM_Constants.cxx
1 // Copyright (C) 2007-2015  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       // deflection coefficient
75       "DeflectionCoeff", // DEFLECTION_COEFF_PROP
76       // point marker data
77       "MarkerType",      // MARKER_TYPE_PROP
78       // material
79       "Material",        // MATERIAL_PROP
80       // general line width
81       "EdgeWidth",       // EDGE_WIDTH_PROP
82       // isos width
83       "IsosWidth",       // ISOS_WIDTH_PROP
84       // top-level flag
85       "TopLevelFlag",    // TOP_LEVEL_PROP
86       // opacity
87       "Opacity",         // OPACITY_PROP
88       // shading color
89       "ShadingColor",    // -
90       // wireframe color
91       "WireframeColor",  // -
92       // standalone edges color
93       "LineColor",       // -
94       // free boundaries color
95       "FreeBndColor",    // -
96       // points color
97       "PointColor",      // -
98       // isos color
99       "IsosColor",       // -
100       // outlines color
101       "OutlineColor",    // -
102       // texture
103       "Texture",         // -
104       // dimensions
105       "Dimensions"       // -
106     };
107     return ( type >= GEOM::Visibility && type <= GEOM::LastProperty ) ? names[type] : QString();
108   }
109
110   /*!
111     \brief Id used for storing properties of objects in study shared between viewers.
112   */
113   int sharedPropertiesId()
114   {
115     return INT_MIN;
116   }
117 } // namespace GEOM