1 // Created on: 1995-01-14
3 // Copyright (c) 1995-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
19 //-Design Declaration des variables specifiques aux Entries de
22 //-Warning Une entry est definie par un index associee a un Marker style
31 #include <Aspect_MarkMapEntry.ixx>
32 #include <TColQuantity_Array1OfLength.hxx>
35 //-Global data definitions
37 // MyStyle : MarkerStyle from Aspect
38 // MyIndex : Integer from Standard
39 // MyStyleIsDef : Boolean from Standard
40 // MyIndexIsDef : Boolean from Standard
48 Aspect_MarkMapEntry::Aspect_MarkMapEntry() :
49 MyStyle(),MyIndex(0),MyStyleIsDef(Standard_True),MyIndexIsDef(Standard_True) {
52 Aspect_MarkMapEntry::Aspect_MarkMapEntry (const Standard_Integer index, const Aspect_MarkerStyle &style) :
53 MyStyle(style),MyIndex(index),MyStyleIsDef(Standard_True),MyIndexIsDef(Standard_True) {
56 Aspect_MarkMapEntry::Aspect_MarkMapEntry (const Aspect_MarkMapEntry& entry) :
57 MyStyle(entry.MyStyle),MyIndex(entry.MyIndex),MyStyleIsDef(Standard_True),MyIndexIsDef(Standard_True) {
59 if ( !entry.MyStyleIsDef || !entry.MyIndexIsDef ) {
60 Aspect_BadAccess::Raise("Unallocated MarkMapEntry") ;
64 void Aspect_MarkMapEntry::SetValue (const Standard_Integer index, const Aspect_MarkerStyle &style) {
66 MyStyleIsDef = Standard_True;
67 MyIndexIsDef = Standard_True;
73 void Aspect_MarkMapEntry::SetValue (const Aspect_MarkMapEntry& entry) {
75 if ( !entry.MyStyleIsDef || !entry.MyIndexIsDef ) {
76 Aspect_BadAccess::Raise("Unallocated MarkMapEntry") ;
79 MyStyleIsDef = Standard_True;
80 MyIndexIsDef = Standard_True;
81 MyIndex = entry.MyIndex;
82 MyStyle = entry.MyStyle;
87 void Aspect_MarkMapEntry::SetStyle (const Aspect_MarkerStyle &style) {
89 MyStyleIsDef = Standard_True;
94 const Aspect_MarkerStyle& Aspect_MarkMapEntry::Style () const {
96 if ( !MyStyleIsDef || !MyIndexIsDef )
97 Aspect_BadAccess::Raise("Unallocated MarkMapEntry") ;
103 void Aspect_MarkMapEntry::SetIndex (const Standard_Integer index) {
105 MyStyleIsDef = Standard_True;
110 Standard_Integer Aspect_MarkMapEntry::Index () const {
112 if ( !MyStyleIsDef || !MyIndexIsDef )
113 Aspect_BadAccess::Raise("Unallocated MarkMapEntry");
119 Standard_Boolean Aspect_MarkMapEntry::IsAllocated () const {
121 return ( MyStyleIsDef && MyIndexIsDef ) ;
125 void Aspect_MarkMapEntry::Free () {
127 MyStyleIsDef = Standard_False;
128 MyIndexIsDef = Standard_False;
132 void Aspect_MarkMapEntry::Dump () const {
134 Aspect_TypeOfMarker type = MyStyle.Type() ;
135 Standard_Integer i,length = MyStyle.Length() ;
136 Standard_Boolean draw = Standard_False ;
137 Standard_Real X(0),Y(0);
139 cout << " Aspect_MarkMapEntry::Dump ()\n";
140 cout << " MyStyleIsDef : " << (MyStyleIsDef ? "True\n" : "False\n");
141 cout << " MyIndexIsDef : " << (MyIndexIsDef ? "True\n" : "False\n");
142 cout << " MarkerStyle : " << (Standard_Integer) type << " Length : " << length << "\n";//WNT
144 for( i=1 ; i<=length ; i++ )
145 draw = MyStyle.Values(i,X,Y);
146 cout << " value("<< i << ") : " << X << "," << Y << "," << draw << "\n";