0023024: Update headers of OCCT files
[occt.git] / src / Aspect / Aspect_MarkMapEntry.cxx
CommitLineData
b311480e 1// Created on: 1995-01-14
2// Created by: GG
3// Copyright (c) 1995-1999 Matra Datavision
4// Copyright (c) 1999-2012 OPEN CASCADE SAS
5//
6// The content of this file is subject to the Open CASCADE Technology Public
7// License Version 6.5 (the "License"). You may not use the content of this file
8// except in compliance with the License. Please obtain a copy of the License
9// at http://www.opencascade.org and read it completely before using this file.
10//
11// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13//
14// The Original Code and all software distributed under the License is
15// distributed on an "AS IS" basis, without warranty of any kind, and the
16// Initial Developer hereby disclaims all such warranties, including without
17// limitation, any warranties of merchantability, fitness for a particular
18// purpose or non-infringement. Please see the License for the specific terms
19// and conditions governing the rights and limitations under the License.
20
7fd59977 21
7fd59977 22
23//-Version
24
25//-Design Declaration des variables specifiques aux Entries de
26// Markers
27
28//-Warning Une entry est definie par un index associee a un Marker style
29
30//-References
31
32//-Language C++ 2.0
33
34//-Declarations
35
36// for the class
37#include <Aspect_MarkMapEntry.ixx>
38#include <TColQuantity_Array1OfLength.hxx>
39//-Aliases
40
41//-Global data definitions
42
43// MyStyle : MarkerStyle from Aspect
44// MyIndex : Integer from Standard
45// MyStyleIsDef : Boolean from Standard
46// MyIndexIsDef : Boolean from Standard
47
48//-Constructors
49
50//-Destructors
51
52//-Methods, in order
53
54Aspect_MarkMapEntry::Aspect_MarkMapEntry() :
55MyStyle(),MyIndex(0),MyStyleIsDef(Standard_True),MyIndexIsDef(Standard_True) {
56}
57
58Aspect_MarkMapEntry::Aspect_MarkMapEntry (const Standard_Integer index, const Aspect_MarkerStyle &style) :
59MyStyle(style),MyIndex(index),MyStyleIsDef(Standard_True),MyIndexIsDef(Standard_True) {
60}
61
62Aspect_MarkMapEntry::Aspect_MarkMapEntry (const Aspect_MarkMapEntry& entry) :
63MyStyle(entry.MyStyle),MyIndex(entry.MyIndex),MyStyleIsDef(Standard_True),MyIndexIsDef(Standard_True) {
64
65 if ( !entry.MyStyleIsDef || !entry.MyIndexIsDef ) {
66 Aspect_BadAccess::Raise("Unallocated MarkMapEntry") ;
67 }
68}
69
70void Aspect_MarkMapEntry::SetValue (const Standard_Integer index, const Aspect_MarkerStyle &style) {
71
72 MyStyleIsDef = Standard_True;
73 MyIndexIsDef = Standard_True;
74 MyIndex = index;
75 MyStyle = style;
76
77}
78
79void Aspect_MarkMapEntry::SetValue (const Aspect_MarkMapEntry& entry) {
80
81 if ( !entry.MyStyleIsDef || !entry.MyIndexIsDef ) {
82 Aspect_BadAccess::Raise("Unallocated MarkMapEntry") ;
83 }
84 else {
85 MyStyleIsDef = Standard_True;
86 MyIndexIsDef = Standard_True;
87 MyIndex = entry.MyIndex;
88 MyStyle = entry.MyStyle;
89 }
90
91}
92
93void Aspect_MarkMapEntry::SetStyle (const Aspect_MarkerStyle &style) {
94
95 MyStyleIsDef = Standard_True;
96 MyStyle = style;
97
98}
99
100const Aspect_MarkerStyle& Aspect_MarkMapEntry::Style () const {
101
102 if ( !MyStyleIsDef || !MyIndexIsDef )
103 Aspect_BadAccess::Raise("Unallocated MarkMapEntry") ;
104
105 return MyStyle;
106
107}
108
109void Aspect_MarkMapEntry::SetIndex (const Standard_Integer index) {
110
111 MyStyleIsDef = Standard_True;
112 MyIndex = index;
113
114}
115
116Standard_Integer Aspect_MarkMapEntry::Index () const {
117
118 if ( !MyStyleIsDef || !MyIndexIsDef )
119 Aspect_BadAccess::Raise("Unallocated MarkMapEntry");
120
121 return MyIndex;
122
123}
124
125Standard_Boolean Aspect_MarkMapEntry::IsAllocated () const {
126
127 return ( MyStyleIsDef && MyIndexIsDef ) ;
128
129}
130
131void Aspect_MarkMapEntry::Free () {
132
133 MyStyleIsDef = Standard_False;
134 MyIndexIsDef = Standard_False;
135
136}
137
138void Aspect_MarkMapEntry::Dump () const {
139
140 Aspect_TypeOfMarker type = MyStyle.Type() ;
141 Standard_Integer i,length = MyStyle.Length() ;
142 Standard_Boolean draw = Standard_False ;
eb901da6 143 Standard_Real X(0),Y(0);
7fd59977 144
145 cout << " Aspect_MarkMapEntry::Dump ()\n";
eb901da6
S
146 cout << " MyStyleIsDef : " << (MyStyleIsDef ? "True\n" : "False\n");
147 cout << " MyIndexIsDef : " << (MyIndexIsDef ? "True\n" : "False\n");
7fd59977 148 cout << " MarkerStyle : " << (Standard_Integer) type << " Length : " << length << "\n";//WNT
149 if( length ) {
150 for( i=1 ; i<=length ; i++ )
151 draw = MyStyle.Values(i,X,Y);
152 cout << " value("<< i << ") : " << X << "," << Y << "," << draw << "\n";
153 }
154 cout << flush;
155}