1 // Copyright (c) 1999-2012 OPEN CASCADE SAS
3 // The content of this file is subject to the Open CASCADE Technology Public
4 // License Version 6.5 (the "License"). You may not use the content of this file
5 // except in compliance with the License. Please obtain a copy of the License
6 // at http://www.opencascade.org and read it completely before using this file.
8 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
9 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
11 // The Original Code and all software distributed under the License is
12 // distributed on an "AS IS" basis, without warranty of any kind, and the
13 // Initial Developer hereby disclaims all such warranties, including without
14 // limitation, any warranties of merchantability, fitness for a particular
15 // purpose or non-infringement. Please see the License for the specific terms
16 // and conditions governing the rights and limitations under the License.
18 #define PRO9581 //GG_270298
19 // Creer la grille dans un objet graphique a l'altitude 0
20 // de facon a etre tracee en premier.
22 // Update 14/07/98 : DCB : PRO10988 SetColorIndices() method
24 #include <V2d_CircularGrid.ixx>
26 #include <V2d_BackgroundGraphicObject.hxx>
28 #include <Graphic2d_GraphicObject.hxx>
30 #include <V2d_Viewer.hxx>
32 V2d_CircularGrid::V2d_CircularGrid(const V2d_ViewerPointer& aViewer,
33 const Standard_Integer aColorIndex1,
34 const Standard_Integer aColorIndex2)
35 : Aspect_CircularGrid(1.,8),
38 myGraphicObject(new V2d_BackgroundGraphicObject(aViewer->View())),
40 myGraphicObject(new Graphic2d_GraphicObject(aViewer->View())),
42 myColorIndex1(aColorIndex1),
43 myColorIndex2(aColorIndex2)
46 Standard_Integer n = (Standard_Integer)log10(l);
47 Standard_Real step = Pow(10.,Standard_Real(n))/10.;
52 void V2d_CircularGrid::SetColorIndices (const Standard_Integer aColorIndex1,
53 const Standard_Integer aColorIndex2)
55 myColorIndex1 = aColorIndex1;
56 myColorIndex2 = aColorIndex2;
59 void V2d_CircularGrid::Display()
61 myGraphicObject->Display();
64 void V2d_CircularGrid::Erase() const
66 myGraphicObject->Erase();
69 void V2d_CircularGrid::UpdateDisplay()
71 myGraphicObject->RemovePrimitives();
72 myGrid = new V2d_CircularGraphicGrid
74 XOrigin(),YOrigin(),RotationAngle(),RadiusStep(),DivisionNumber(),myColorIndex2);
75 myGrid->SetColorIndex(myColorIndex1);
76 myGrid->SetDrawMode(DrawMode());
79 Standard_Boolean V2d_CircularGrid::IsDisplayed () const
81 return myGraphicObject->IsDisplayed();