]> OCCT Git - occt.git/commitdiff
0022982: Generic color is overriden in STEPCAFControl_Writer::WriteColors
authorGKA <>
Fri, 17 Feb 2012 12:20:39 +0000 (12:20 +0000)
committerbugmaster <bugmaster@opencascade.com>
Mon, 5 Mar 2012 15:32:52 +0000 (19:32 +0400)
src/STEPCAFControl/STEPCAFControl_Writer.cxx
src/XCAFDoc/XCAFDoc.cdl
src/XCAFDoc/XCAFDoc_ColorTool.cdl
src/XDEDRAW/XDEDRAW_Colors.cxx

index 2e71c3fa6b46e56baf80a68dd0a2a125f75b1d8e..4e985fca5b4c0bba62c9c134aff4649a50dc333c 100755 (executable)
@@ -1039,13 +1039,14 @@ Standard_Boolean STEPCAFControl_Writer::WriteColors (const Handle(XSControl_Work
         }
       }
       if ( CTool->GetColor ( lab, XCAFDoc_ColorGen, C ) ) {
-       style.SetColorCurv ( C );
-       style.SetColorSurf ( C );
+        style.SetColorCurv ( C );
+        style.SetColorSurf ( C );
       }
       if ( CTool->GetColor ( lab, XCAFDoc_ColorSurf, C ) )
-       style.SetColorSurf ( C );
+        style.SetColorSurf ( C );
       if ( CTool->GetColor ( lab, XCAFDoc_ColorCurv, C ) )
-       style.SetColorCurv ( C );
+        style.SetColorCurv ( C );
+      
       // commented, cause we are need to take reference from 
 //       if ( isComponent && lab == L && !isVisible)
 //         if ( !style.IsSetColorSurf() && !style.IsSetColorCurv() ) {
index 7157774873b8e7fff8a80c29af1d796aa8fd395d..7c6fc462defdadd19daa5e35338debdf12bc02de 100755 (executable)
@@ -38,7 +38,13 @@ is
 
     enumeration ColorType is
        ---Purpose: Defines types of color assignments
-       ColorGen,   -- simple color
+       --          Color of shape is defined following way
+    --          in dependance with type of color.
+    --          If type of color is XCAFDoc_ColorGen - then this color 
+    --          defines default color for surfaces and curves.
+    --          If for shape color with types XCAFDoc_ColorSurf or XCAFDoc_ColorCurv is specified
+    --          then such color overrides generic color. 
+    ColorGen,   -- simple color
        ColorSurf,  -- color of surfaces
        ColorCurv   -- color of curves
     end ColorType;
index ca1ebfd8c4347518742ffe3db7165cbd1a844d89..4d22765efa2dc7e8c84f0a35a6a883d3a653ba7e 100755 (executable)
@@ -84,7 +84,12 @@ is
                  type : ColorType from XCAFDoc);
        ---Purpose: Sets a link with GUID defined by <type> (see 
        --          XCAFDoc::ColorRefGUID()) from label <L> to color
-       --          defined by <colorL>
+       --          defined by <colorL>. Color of shape is defined following way
+       --          in dependance with type of color.
+       --          If type of color is XCAFDoc_ColorGen - then this color 
+       --          defines default color for surfaces and curves.
+       --          If for shape color with types XCAFDoc_ColorSurf or XCAFDoc_ColorCurv is specified
+       --          then such color overrides generic color.  
     
     SetColor (me; L: Label from TDF;
                  Color: Color from Quantity;
index 601ee54a3a63f34cfa883aae1eb4b45c908e4c6e..1a3fd42492b5150c5ccf8f0af62de925371cb612 100755 (executable)
@@ -360,7 +360,8 @@ void XDEDRAW_Colors::InitCommands(Draw_Interpretor& di)
   
   Standard_CString g = "XDE color's commands";
   
-  di.Add ("XSetColor","Doc {Label|Shape} R G B \t: Set color [R G B] to shape given by Label",
+  di.Add ("XSetColor","Doc {Label|Shape} R G B [c|s]\t: Set color [R G B] to shape given by Label, "
+                      "type of color 's' - for surface, 'c' - for curve (default generic)",
                   __FILE__, setColor, g);
 
   di.Add ("XGetColor","Doc label \t: Return color defined on label in colortable",