0022048: Visualization, AIS_InteractiveContext - single object selection should alway...
[occt.git] / src / Vrml / Vrml_Cone.cxx
1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
2 //
3 // This file is part of Open CASCADE Technology software library.
4 //
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
10 //
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
13
14
15 #include <Vrml_Cone.hxx>
16
17 Vrml_Cone::Vrml_Cone(const Vrml_ConeParts aParts,
18                      const Standard_Real aBottomRadius,
19                      const Standard_Real aHeight)
20 {
21     myParts = aParts;
22     myBottomRadius = aBottomRadius;
23     myHeight = aHeight;
24 }
25
26  void Vrml_Cone::SetParts(const Vrml_ConeParts aParts) 
27 {
28     myParts = aParts;
29 }
30
31  Vrml_ConeParts Vrml_Cone::Parts() const
32 {
33   return myParts;
34 }
35
36  void Vrml_Cone::SetBottomRadius(const Standard_Real aBottomRadius) 
37 {
38     myBottomRadius = aBottomRadius;
39 }
40
41  Standard_Real Vrml_Cone::BottomRadius() const
42 {
43   return myBottomRadius;
44 }
45
46  void Vrml_Cone::SetHeight(const Standard_Real aHeight) 
47 {
48     myHeight = aHeight;
49 }
50
51  Standard_Real Vrml_Cone::Height() const
52 {
53   return myHeight;
54 }
55
56  Standard_OStream& Vrml_Cone::Print(Standard_OStream& anOStream) const
57 {
58  anOStream  << "Cone {\n";
59
60   switch ( myParts )
61     {
62      case Vrml_ConeALL: break; // anOStream  << "    parts\t\tALL ";
63      case Vrml_ConeSIDES:  anOStream  << "    parts\t\tSIDES\n"; break;
64      case Vrml_ConeBOTTOM: anOStream  << "    parts\t\tBOTTOM\n"; break; 
65     }
66
67  if ( Abs(myBottomRadius - 1 ) > 0.0001 )
68    {
69     anOStream  << "    bottomRadius\t";
70     anOStream << myBottomRadius << "\n";
71    }
72
73  if ( Abs(myHeight - 2 ) > 0.0001 )
74    {
75     anOStream  << "    height\t\t";
76     anOStream << myHeight << "\n";
77    }
78
79  anOStream  << "}\n";
80  return anOStream;
81 }