summaryrefslogtreecommitdiff
path: root/src/Aspect/Aspect_MarkMapEntry.cxx
blob: 646e5372ef22e1fc52c1c2136a0fa59e643ce17f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140

// File         Aspect_MarkMapEntry.cxx
// Created      Janvier 1995
// Author       GG

//-Copyright    MatraDatavision 1991,1992,1993,1994

//-Version

//-Design       Declaration des variables specifiques aux Entries de 
//		Markers 

//-Warning      Une entry est definie par un index associee a un Marker style

//-References

//-Language     C++ 2.0

//-Declarations

// for the class
#include <Aspect_MarkMapEntry.ixx>
#include <TColQuantity_Array1OfLength.hxx>
//-Aliases

//-Global data definitions

//      MyStyle      		: MarkerStyle from Aspect
//      MyIndex   		: Integer from Standard
//      MyStyleIsDef		: Boolean from Standard
//      MyIndexIsDef		: Boolean from Standard

//-Constructors

//-Destructors

//-Methods, in order

Aspect_MarkMapEntry::Aspect_MarkMapEntry() : 
MyStyle(),MyIndex(0),MyStyleIsDef(Standard_True),MyIndexIsDef(Standard_True) {
}

Aspect_MarkMapEntry::Aspect_MarkMapEntry (const Standard_Integer index, const Aspect_MarkerStyle &style) :
MyStyle(style),MyIndex(index),MyStyleIsDef(Standard_True),MyIndexIsDef(Standard_True) {
}

Aspect_MarkMapEntry::Aspect_MarkMapEntry (const Aspect_MarkMapEntry& entry) :
MyStyle(entry.MyStyle),MyIndex(entry.MyIndex),MyStyleIsDef(Standard_True),MyIndexIsDef(Standard_True) {

	if ( !entry.MyStyleIsDef || !entry.MyIndexIsDef ) {
		Aspect_BadAccess::Raise("Unallocated MarkMapEntry") ;
	}
}

void Aspect_MarkMapEntry::SetValue (const Standard_Integer index, const Aspect_MarkerStyle &style) {

	MyStyleIsDef	= Standard_True;
	MyIndexIsDef	= Standard_True;
	MyIndex		= index;
	MyStyle		= style;

}

void Aspect_MarkMapEntry::SetValue (const Aspect_MarkMapEntry& entry) {

	if ( !entry.MyStyleIsDef || !entry.MyIndexIsDef ) {
		Aspect_BadAccess::Raise("Unallocated MarkMapEntry") ;
	}
	else {
		MyStyleIsDef	= Standard_True;
		MyIndexIsDef	= Standard_True;
		MyIndex		= entry.MyIndex;
		MyStyle		= entry.MyStyle;
	}

}

void Aspect_MarkMapEntry::SetStyle (const Aspect_MarkerStyle &style) {

	MyStyleIsDef	= Standard_True;
	MyStyle		= style;

}

const Aspect_MarkerStyle& Aspect_MarkMapEntry::Style () const {

	if ( !MyStyleIsDef || !MyIndexIsDef ) 
		Aspect_BadAccess::Raise("Unallocated MarkMapEntry") ;

	return MyStyle;

}

void Aspect_MarkMapEntry::SetIndex (const Standard_Integer index) {

	MyStyleIsDef	= Standard_True;
	MyIndex		= index;

}

Standard_Integer Aspect_MarkMapEntry::Index () const {

	if ( !MyStyleIsDef || !MyIndexIsDef ) 
		Aspect_BadAccess::Raise("Unallocated MarkMapEntry");

	return MyIndex;

}

Standard_Boolean Aspect_MarkMapEntry::IsAllocated () const {

	return ( MyStyleIsDef && MyIndexIsDef ) ; 

}

void Aspect_MarkMapEntry::Free () {

	MyStyleIsDef	= Standard_False;
	MyIndexIsDef	= Standard_False;

}

void Aspect_MarkMapEntry::Dump () const {

  Aspect_TypeOfMarker type = MyStyle.Type() ;
  Standard_Integer i,length = MyStyle.Length() ;
  Standard_Boolean draw = Standard_False ;
  Standard_Real X = 0,Y = 0;

  cout << " Aspect_MarkMapEntry::Dump ()\n";
  cout << "      MyStyleIsDef : " << (MyStyleIsDef ? "True\n" : "False\n");
  cout << "      MyIndexIsDef : " << (MyIndexIsDef ? "True\n" : "False\n");
  cout << "      MarkerStyle : " << (Standard_Integer) type << " Length : " << length << "\n";//WNT
  if( length ) {
    for( i=1 ; i<=length ; i++ ) 
	draw = MyStyle.Values(i,X,Y);
	cout << "		value("<< i << ") : " << X << "," << Y << "," << draw << "\n";
  }
  cout << flush;
}