summaryrefslogtreecommitdiff
path: root/src/PlotMgt/PlotMgt_PlotterParameter.cxx
blob: 0a31bef300a02ddd75a0c0380f0a99a5c3911857 (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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
// File:        PlotMgt_PlotterParameter.cxx
// Created:     Quebex 30 October 1998
// Author:      DCB
// Copyright:   MatraDatavision 1998

#include <PlotMgt.hxx>
#include <PlotMgt_PlotterParameter.ixx>
#include <PlotMgt_PlotterTools.hxx>

// Removes str at index <idx2> and puts it before <idx1>
#define SWAP_STR(idx1,idx2)                  \
{                                            \
  TCollection_AsciiString str;               \
  str = myDescription -> Value(idx2);        \
  myDescription -> Remove (idx2);            \
  myDescription -> InsertBefore (idx1, str); \
}

#define STRING_TRIM(aString) \
  aString.LeftAdjust();      \
  aString.RightAdjust();

#define FLAG_DIALOG   0x00000001
#define FLAG_MINVAL   0x00000002
#define FLAG_MAXVAL   0x00000004
#define FLAG_VALUES   0x00000008
#define FLAG_LENGTH   0x00000010
#define FLAG_DEFVAL   0x00000020
#define FLAG_NTYPE    0x00000040

//============================================================================
PlotMgt_PlotterParameter::PlotMgt_PlotterParameter (const TCollection_AsciiString& aName)
{
  myName        = aName;
  myOldName     = "";
  myType        = PlotMgt_TOPP_Undefined;
  myIndex       = -1;
  myState       = Standard_False;
  myConfigState = Standard_False;
  myIsModified  = Standard_False;
  //--------------------------------------------------------------
  myFlags       = 0;
  myDialog      = "";
  myMinValue    = "";
  myMaxValue    = "";
  myValues      = "";
  myDefValue    = "";
  myMapLength   = 0;
  myMap         = new TColStd_HSequenceOfAsciiString ();
  myDescription = new TColStd_HSequenceOfAsciiString ();
  //---- Find parameter's index in __PossibleParameters array ----
  Standard_Integer i = 0;
  while (__PossibleParameters[i]._new_name != NULL) {
    if ( myName == __PossibleParameters[i]._new_name ||
         (__PossibleParameters[i]._old_name && myName == __PossibleParameters[i]._old_name))
    {
      if (__PossibleParameters[i]._old_name)
        myOldName = __PossibleParameters[i]._old_name;
      myName  = __PossibleParameters[i]._new_name;
      myIndex = i;
      break;
    }
    i++;
  }
  if (myIndex == -1) {
    cout << "PlotMgt_PlotterParameter WARNING: Unknown parameter'"
         << myName << "'\n" << flush;
    return;
  }
}

//============================================================================
#define PUT_INFO(aSign,aValue) {                             \
  sprintf(aBuffer,"%s%s%s%s\n", myName.ToCString(), (aSign), \
          _DELIM_SIGN, aValue.ToCString());                  \
  aLine += aBuffer;            }

//============================================================================
Standard_Boolean PlotMgt_PlotterParameter::Save (OSD_File& aFile)
{
  char aBuffer [1024];
  TCollection_AsciiString aLine = "";
  if (NeedToBeSaved ()) {
    //-----------------------------------------------------
    if (!myOldName.IsEmpty ()) {
      sprintf (aBuffer, "! %s (%s) parameter\n", myName.ToCString(),
        myOldName.ToCString());
      aLine += aBuffer;
    }
    //------------ Write Type info ------------------------
    if (myFlags & FLAG_NTYPE )  PUT_INFO(_TYPE_SIGN, PlotMgt::StringFromType (myType));
    //------------ Write dialog info ----------------------
    if (myFlags & FLAG_DIALOG)  PUT_INFO(_DIALOG_SIGN, myDialog);
    //------------ Write minval info ----------------------
    if (myFlags & FLAG_MINVAL)  PUT_INFO(_MINVAL_SIGN, myMinValue);
    //------------ Write maxval info ----------------------
    if (myFlags & FLAG_MAXVAL)  PUT_INFO(_MAXVAL_SIGN, myMaxValue);
    //------------ Write values info ----------------------
    if (myFlags & FLAG_VALUES)  PUT_INFO(_VALUES_SIGN, myValues);
    //------------ Write defavl info ----------------------
    if (myFlags & FLAG_DEFVAL)  PUT_INFO("", myDefValue);
    //------------ Write map info -------------------------
    if (myFlags & FLAG_LENGTH && myMapLength && !myMap.IsNull()) {
      Standard_Integer i, n = myMap -> Length();
      aLine += myName; aLine += _LENGTH_SIGN;
      aLine += _DELIM_SIGN; aLine += TCollection_AsciiString (myMapLength);
      aLine += "\n";
      for (i = 1; i <= n; i++)
        PUT_INFO("", myMap -> Value (i));
    }
    //------------ Append one new line --------------------
    aLine += "\n";
    aFile.Write (aLine, aLine.Length ());
    return (!aFile.Failed ());
  }
  return Standard_True;
}

//============================================================================
void PlotMgt_PlotterParameter::SetType (const PlotMgt_TypeOfPlotterParameter aType)
{
  myType = aType;
}

//============================================================================
void PlotMgt_PlotterParameter::SetState (const Standard_Boolean aState)
{
  myState = aState;
}

//============================================================================
TCollection_AsciiString PlotMgt_PlotterParameter::Name () const
{
  return myName;
}

//============================================================================
TCollection_AsciiString PlotMgt_PlotterParameter::OldName () const
{
  return myOldName;
}

//============================================================================
Handle(TColStd_HSequenceOfAsciiString)& PlotMgt_PlotterParameter::Description ()
{
  return myDescription;
}

//============================================================================
Standard_Boolean PlotMgt_PlotterParameter::NeedToBeSaved () const
{
  return (myConfigState && (myType != _T_UNK) && (myIsModified || myState));
}

//============================================================================
void PlotMgt_PlotterParameter::Dump () const
{
  if (!myState || (myType == _T_UNK) ||
      !myConfigState || !myIsModified)
    return;

  cout << "!++++++++++++++++++++++++++++++++++++++++++++" << endl << flush;
  cout << "! " << myName << " ";
  if (!myOldName.IsEmpty())
    cout << "(" << myOldName << ") ";
  cout << "parameter" << endl << flush;
  cout << myName << _TYPE_SIGN << _DELIM_SIGN
       << PlotMgt::StringFromType (myType) << endl << flush;
  if (myFlags & FLAG_DIALOG)
    cout << myName << _DIALOG_SIGN << _DELIM_SIGN << myDialog << endl << flush;
  if (myFlags & FLAG_MINVAL)
    cout << myName << _MINVAL_SIGN << _DELIM_SIGN << myMinValue << endl << flush;
  if (myFlags & FLAG_MAXVAL)
    cout << myName << _MAXVAL_SIGN << _DELIM_SIGN << myMaxValue << endl << flush;
  if (myFlags & FLAG_VALUES && (myType == _T_LSTR))
    cout << myName << _VALUES_SIGN << _DELIM_SIGN << myValues << endl << flush;
  if (myFlags & FLAG_DEFVAL)
    cout << myName << _DELIM_SIGN << myDefValue << endl << flush;
  if (myFlags & FLAG_LENGTH && myMapLength) {
    cout << myName << _LENGTH_SIGN << _DELIM_SIGN << myMapLength << endl << flush;
    Standard_Integer i, n = myMap -> Length();
    for (i = 1; i <= n; i++)
      cout << myName << _DELIM_SIGN << myMap -> Value (i) << endl << flush;
  }
  cout << "!++++++++++++++++++++++++++++++++++++++++++++" << endl << flush;
  cout << endl << flush;
}

//============================================================================
void PlotMgt_PlotterParameter::PutCommandInfo (const Aspect_FStream& outStream) const
{
#ifdef WNT
  TCollection_AsciiString _setenv_  ("set Plot_");
  TCollection_AsciiString _comment_ ("REM ######### ");
  TCollection_AsciiString _delim_   (" = ");
#else
  TCollection_AsciiString _setenv_  ("setenv Plot_");
  TCollection_AsciiString _comment_ ("############# ");
  TCollection_AsciiString _delim_   (" ");
#endif // WNT
  *outStream << _comment_ << "Parameter '" << myName << "' of type '"
             << PlotMgt::StringFromType (myType) << "'" << endl;

  if (myFlags & FLAG_DEFVAL)
    *outStream << _setenv_ << myName << _delim_ << "'" << myDefValue << "'" << endl;

  if (myFlags & FLAG_LENGTH && myMapLength) {
    *outStream << _setenv_ << myName << "_Length" << _delim_ << myMapLength << endl;
    Standard_Integer i, n = myMap -> Length();
    for (i = 1; i <= n; i++)
      *outStream << _setenv_ << myName << "_" << i << _delim_ << myMap -> Value (i) << endl;
  }
}

//============================================================================
Standard_Boolean PlotMgt_PlotterParameter::CheckListValue ()
{
  if (!(myFlags & FLAG_VALUES)) {
    cout << "PlotMgt_PlotterParameter WARNING: Parameter '" << myName
         << "' has type 'list_string', but does not have [.Values] "
         << "descriptor" << endl << flush;
    return Standard_False;
  }
  TCollection_AsciiString aValues = myValues, aToken, newValues;
  Standard_Boolean commaFound, defValFound = Standard_False;
  Standard_Integer idx, res;
  STRING_TRIM(myDefValue);
  STRING_TRIM(myValues);
  if (myValues.IsEmpty()) {
    if (!myDefValue.IsEmpty()) {
      cout << "PlotMgt_PlotterParameter WARNING: Parameter '" << myName
           << "' has type 'list_string', but [.Values] descriptor "
           << "is empty. Defaulting to '" << myDefValue << "'" << endl << flush;
      myValues = myDefValue;
      return Standard_True;
    } else {
      cout << "PlotMgt_PlotterParameter WARNING: Parameter '" << myName
           << "' has type 'list_string', but [.Values] descriptor "
           << "and default values are empty." << endl << flush;
      return Standard_False;
    }
  }
  do {
    idx = aValues.Search (",");
    commaFound = (idx != -1);
    if (commaFound) {
      aToken = aValues.Token (",", 1);
      res = aValues.Search (aToken);
      if (res != 1)
        aValues.Remove (1, res - 1);
      aValues.Remove (1, aToken.Length() + 1);
    } else {
      aToken = aValues;
    }
    STRING_TRIM(aToken);
    // Still trying to find default value
    if (!defValFound)
      defValFound = (aToken == myDefValue);
    // Append new values with a token
    if (!aToken.IsEmpty())
      newValues += aToken;
    if (commaFound && !aToken.IsEmpty())
      newValues += ",";
  } while (commaFound);
  // Check the default value
  if (!defValFound) {
    cout << "PlotMgt_PlotterParameter WARNING: Parameter '" << myName
         << "' has type 'list_string'. ";
    if (myFlags & FLAG_DEFVAL)
      cout << "But the default value '" << myDefValue << "' is not found. ";
    else
      cout << "But does not have default value. ";
    cout << "Defaulting to the first from the list." << endl << flush;
    idx = newValues.Search (",");
    if (idx != -1) myDefValue = newValues.Token (",", 1);
    else           myDefValue = newValues;
    myFlags |= FLAG_DEFVAL;
  }
  // Use new values as default
  myValues = newValues;
  return Standard_True;
}

//============================================================================
void PlotMgt_PlotterParameter::ProcessParamVal (
                               const Standard_CString   aParamSign,
                               const Standard_Integer   aFlag,
                               TCollection_AsciiString& aValue)
{
  Standard_Integer i, n = myDescription -> Length ();
  TCollection_AsciiString searchStr = myName, aLine;
//JR/Hp
  searchStr += (Standard_CString ) (aParamSign ? aParamSign : "");
//  searchStr += (aParamSign ? aParamSign : "");
  searchStr += _DELIM_SIGN;

  aValue = "";
  for (i = n; i >= 1; i--) {
    aLine = myDescription -> Value(i);
    Standard_Integer res = aLine.Search(searchStr);
    if (res != -1) {
      aLine.Remove (1, searchStr.Length());
      STRING_TRIM(aLine);
      myFlags |= aFlag;
      aValue   = aLine;
      // Remove all other <aParamSign> strings
      Standard_Integer j = 1;
      while (j <= n) {
        if (myDescription -> Value(j).Search(searchStr) != -1) {
          myDescription -> Remove (j);
          n--;
        } else j++;
      }
      break;
    }
  }
}

//============================================================================
void PlotMgt_PlotterParameter::Normalize ()
{
  Standard_Integer n, i;
  TCollection_AsciiString aMapLen;
  // Quit if the parameter is not found in __PossibleParameters
  if (myIndex == -1)
    goto _CLEAR_AND_EXIT;
  // Check parameter's type in __PossibleParameters array
  if (myType == _T_UNK || myType != __PossibleParameters[myIndex]._type) {
    cout << "PlotMgt_PlotterParameter WARNING: Incorrect type of '"
         << myName << "' parameter : '"
         << PlotMgt::StringFromType (myType) << "' instead of '"
         << PlotMgt::StringFromType (__PossibleParameters[myIndex]._type)
         << "'. Using right TYPE.\n" << flush;
    myType = __PossibleParameters[myIndex]._type;
    myFlags |= FLAG_NTYPE;
  }
  // Change old names to new ones (if any)
  if (!myOldName.IsEmpty ()) {
    n = myDescription -> Length ();
    TCollection_AsciiString aLine;
    for (i = 1; i <= n; i++) {
      aLine = myDescription -> Value (i);
      Standard_Integer res = aLine.Search (myOldName);
      if (res != -1) {
        aLine.Remove (1, myOldName.Length());
        aLine.Insert (1, myName);
        myDescription -> SetValue (i, aLine);
      }
    }
  }
  // Normalize parameter (build all necessary values)
  ProcessParamVal (_DIALOG_SIGN, FLAG_DIALOG, myDialog);
  ProcessParamVal (_MINVAL_SIGN, FLAG_MINVAL, myMinValue);
  ProcessParamVal (_MAXVAL_SIGN, FLAG_MAXVAL, myMaxValue);
  ProcessParamVal (_VALUES_SIGN, FLAG_VALUES, myValues);
  ProcessParamVal (_LENGTH_SIGN, FLAG_LENGTH, aMapLen);
  if ((myFlags & FLAG_LENGTH) && aMapLen.IsIntegerValue())
    myMapLength = aMapLen.IntegerValue();
  switch (myType) {
    case _T_INT:
    case _T_REAL:
    case _T_BOOL:
    case _T_STR: {
        if (!__PossibleParameters[myIndex]._ismap) {
          ProcessParamVal (NULL, FLAG_DEFVAL, myDefValue);
        } else {
          n = myDescription -> Length ();
          // There must me at least <myMapLen> of default values
          if (myMapLength > n || myMapLength == 0) {
            cout << "PlotMgt_PlotterParameter WARNING: Bad Map description: present "
                 << "only " << n << " instead of " << myMapLength << " values in '"
                 << myName << "'" << endl;
            goto _CLEAR_AND_EXIT;
          }
          // Put lines from the end of description
          for (i = n - myMapLength + 1; i <= n; i++)
            myMap -> Append (myDescription -> Value (i));
          myFlags &= ~FLAG_DEFVAL;
          // Leave only map values
          TCollection_AsciiString remStr = (myName + _DELIM_SIGN), aLine;
          n = myMap -> Length ();
          for (i = 1; i <= n; i++) {
            aLine = myMap -> Value (i);
            if (aLine.Search(remStr) != -1) {
              aLine.Remove (1, remStr.Length());
              myMap -> SetValue (i, aLine);
            }
          }
        }
      } break;
    case _T_LSTR: {
        ProcessParamVal (NULL, FLAG_DEFVAL, myDefValue);
      } break;
#ifndef DEB
    default:
      break ;
#endif
  }
  // Check the configuration
  if (myFlags & FLAG_DEFVAL && myDefValue.IsEmpty())
    myFlags &= ~FLAG_DEFVAL;
  if (myFlags & FLAG_DEFVAL && (myType == _T_INT)) {
    if (!myDefValue.IsIntegerValue()) {
      myDefValue = "";
      myFlags &= ~FLAG_DEFVAL;
    }
  }
  if (myFlags & FLAG_DEFVAL && (myType == _T_REAL)) {
    if (!myDefValue.IsRealValue()) {
      myDefValue = "";
      myFlags &= ~FLAG_DEFVAL;
    }
  }
  if (myFlags & FLAG_DEFVAL && (myType == _T_BOOL)) {
    STRING_TRIM(myDefValue);
    myDefValue.LowerCase ();
    if (myDefValue.IsEmpty ())
      myFlags &= ~FLAG_DEFVAL;
  }
  if (myType == _T_LSTR && !CheckListValue ())
    goto _CLEAR_AND_EXIT;
  // Indicate that parameter is configured properly
  myConfigState = Standard_True;
_CLEAR_AND_EXIT:
  //Dump ();
  // We do not need it anymore
  myDescription->Clear ();
  myDescription.Nullify();
}

//============================================================================
//============================================================================
//============================================================================
#define GET_BAD_TYPE_INFO(aGetType)                              \
  cout << "PlotMgt_PlotterParameter ---> WARNING : '" << myName  \
       << "' of type '" << PlotMgt::StringFromType (myType)      \
       << "' requested about " << aGetType << " value"           \
       << endl << flush;

#define GET_EMPTY_VALUE_INFO(aValue)                             \
  cout << "PlotMgt_PlotterParameter ---> WARNING : '" << myName  \
       << "' of type '" << PlotMgt::StringFromType (myType)      \
       << "' has no default value."                              \
       << "Defaulting to " << aValue << "." << endl << flush;

//============================================================================
void PlotMgt_PlotterParameter::SValue (TCollection_AsciiString& aValue) const
{
  aValue = "";
  if ((myType == _T_STR) || (myType == _T_LSTR)) {
    if (myFlags & FLAG_DEFVAL && !myDefValue.IsEmpty()) {
      aValue = myDefValue;
    } else
      GET_EMPTY_VALUE_INFO("empty string");
  } else
    GET_BAD_TYPE_INFO("STRING");
}

//============================================================================
Standard_Boolean PlotMgt_PlotterParameter::BValue () const
{
  if (myType == _T_BOOL) {
    if (myFlags & FLAG_DEFVAL && !myDefValue.IsEmpty()) {
      if (myDefValue.IsEqual("true") ||
            (myDefValue.IsIntegerValue() && myDefValue.IntegerValue()))
        return Standard_True;
    } else
      GET_EMPTY_VALUE_INFO("FALSE");
  } else
    GET_BAD_TYPE_INFO("BOOLEAN");
  return Standard_False;
}

//============================================================================
Standard_Integer PlotMgt_PlotterParameter::IValue () const
{
  if (myType == _T_INT) {
    if (myFlags & FLAG_DEFVAL) {
      return myDefValue.IntegerValue ();
    } else
      GET_EMPTY_VALUE_INFO("0");
  } else
    GET_BAD_TYPE_INFO("INTEGER");
  return 0;
}

//============================================================================
Standard_Real PlotMgt_PlotterParameter::RValue () const
{
  if (myType == _T_REAL) {
    if (myFlags & FLAG_DEFVAL) {
      return myDefValue.RealValue ();
    } else
      GET_EMPTY_VALUE_INFO("0.0");
  } else
    GET_BAD_TYPE_INFO("REAL");
  return 0.0;
}

//============================================================================
void PlotMgt_PlotterParameter::LValues (Handle(TColStd_HSequenceOfAsciiString)& aList) const
{
  if (!aList.IsNull ()) {
    aList->Clear  ();
    aList.Nullify ();
  }
  aList = new TColStd_HSequenceOfAsciiString ();
  if (myType != _T_LSTR) {
    GET_BAD_TYPE_INFO("LIST_STRING");
    return;
  }
  TCollection_AsciiString aToken, aValues = myValues;
  Standard_Boolean commaFound;
  Standard_Integer idx;
  do {
    idx = aValues.Search (",");
    commaFound = (idx != -1);
    if (commaFound) {
      aToken = aValues.Token (",", 1);
      aValues.Remove (1, aToken.Length() + 1);
    } else {
      aToken = aValues;
    }
    aList -> Append (aToken);
  } while (commaFound);
}

//============================================================================
Handle(TColStd_HSequenceOfAsciiString) PlotMgt_PlotterParameter::MValue () const
{
  if (!(myFlags & FLAG_LENGTH && myMapLength))
    GET_BAD_TYPE_INFO("MAP_VALUE");
  return myMap;
}

//============================================================================
//============================================================================
//============================================================================
#define SET_VALUE()              \
  myDefValue    = aValue;        \
  myFlags       = FLAG_DEFVAL;   \
  myIsModified  = Standard_True;
//  myFlags      != FLAG_DEFVAL;

#define SET_BAD_TYPE_INFO(aSetType)                              \
{                                                                \
  cout << "PlotMgt_PlotterParameter ---> WARNING : '" << myName  \
       << "' of type '" << PlotMgt::StringFromType (myType)      \
       << "' requested to set " << aSetType << " value"          \
       << endl << flush;                                         \
  return;                                                        \
}

//============================================================================
void PlotMgt_PlotterParameter::SetSValue (const TCollection_AsciiString& aValue)
{
  if (myType != _T_STR && myType != _T_LSTR)
    SET_BAD_TYPE_INFO("STRING");
  SET_VALUE();
}

//============================================================================
void PlotMgt_PlotterParameter::SetBValue (const Standard_Boolean aValue)
{
  if (myType != _T_BOOL)
    SET_BAD_TYPE_INFO("BOOL");
//JR/Hp
  myDefValue    = (Standard_CString ) (aValue ? "true" : "false");
//  myDefValue    = (aValue ? "true" : "false");
//  myFlags      != FLAG_DEFVAL;
  myFlags       = FLAG_DEFVAL;
  myIsModified  = Standard_True;
}

//============================================================================
void PlotMgt_PlotterParameter::SetIValue (const Standard_Integer aValue)
{
  if (myType != _T_INT)
    SET_BAD_TYPE_INFO("INTEGER");
  SET_VALUE();
}

//============================================================================
void PlotMgt_PlotterParameter::SetRValue (const Standard_Real aValue)
{
  if (myType != _T_REAL)
    SET_BAD_TYPE_INFO("REAL");
  SET_VALUE();
}

//============================================================================
void PlotMgt_PlotterParameter::SetMValue (const Handle(TColStd_HSequenceOfAsciiString)& aMap)
{
  if (!(myFlags & FLAG_LENGTH && myMapLength))
    SET_BAD_TYPE_INFO("MAP_VALUE");
  myMap        = aMap;
  myMapLength  = myMap -> Length ();
  myIsModified = Standard_True;
}