Salome HOME
aa1b7ec04dc256d9ce952ae4b75a53cd2008a8ac
[modules/geom.git] / src / OBJECT / GEOM_Constants.cxx
1 // Copyright (C) 2007-2012  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.
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 namespace GEOM
29 {
30
31   /*!
32     \brief Get minimal allowed value for deflection coefficient
33   */
34   double minDeflection()
35   {
36     return 1e-06; // DEFLECTION_MIN
37   }
38
39   /*!
40     \brief Get character used to separate parameter names
41   */
42   QString sectionSeparator()
43   {
44     return "_"; // NAME_SEPARATOR
45   }
46
47   /*!
48     \brief Get character used to separate numeric parameter values (color = r:g:b)
49   */
50   QString subSectionSeparator()
51   {
52     return ":"; // DIGIT_SEPARATOR
53   }
54   
55   QString propertyName( Property type )
56   {
57     static const char* names[] = {
58       // visibility 
59       "Visibility",      // VISIBILITY_PROP
60       // transparency
61       "Transparency",    // TRANSPARENCY_PROP
62       // display mode
63       "DisplayMode",     // DISPLAY_MODE_PROP
64       // number of the iso lines (along u and v directions)
65       "Isos",            // ISOS_PROP
66       // main / shading color
67       "Color",           // COLOR_PROP
68       // "show edges direction" flag
69       "VectorMode",      // VECTOR_MODE_PROP
70       // deflection coefficient
71       "DeflectionCoeff", // DEFLECTION_COEFF_PROP
72       // point marker data
73       "MarkerType",      // MARKER_TYPE_PROP
74       // material
75       "Material",        // MATERIAL_PROP
76       // general line width
77       "EdgeWidth",       // EDGE_WIDTH_PROP
78       // isos width
79       "IsosWidth",       // ISOS_WIDTH_PROP
80       // top-level flag
81       "TopLevelFlag",    // TOP_LEVEL_PROP
82       // opacity
83       "Opacity",         // OPACITY_PROP
84       // shading color
85       "ShadingColor",    // -
86       // wireframe color
87       "WireframeColor",  // -
88       // standalone edges color
89       "LineColor",       // -
90       // free boundaries color
91       "FreeBndColor",    // -
92       // points color
93       "PointColor",      // -
94       // isos color
95       "IsosColor",       // -
96       // outlines color
97       "OutlineColor",    // -
98     };
99     return ( type >= GEOM::Visibility && type <= GEOM::LastProperty ) ? names[type] : QString();
100   }
101
102 } // namespace GEOM