summaryrefslogtreecommitdiff
path: root/src/IGESDimen/IGESDimen_ToolNewGeneralNote.cxx
blob: 9aaf830838a6cc599065ea4c419a0a794e18e886 (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
//--------------------------------------------------------------------
//
//  File Name : IGESDimen_NewGeneralNote.cxx
//  Date      :
//  Author    : CKY / Contract Toubro-Larsen
//  Copyright : MATRA-DATAVISION 1993
//
//--------------------------------------------------------------------

#include <IGESDimen_ToolNewGeneralNote.ixx>
#include <IGESData_ParamCursor.hxx>
#include <gp_XYZ.hxx>
#include <IGESData_IGESEntity.hxx>
#include <TCollection_HAsciiString.hxx>
#include <TColgp_HArray1OfXYZ.hxx>
#include <IGESData_HArray1OfIGESEntity.hxx>
#include <Interface_HArray1OfHAsciiString.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <IGESData_Dump.hxx>
#include <Interface_Macros.hxx>
#include <stdio.h>


IGESDimen_ToolNewGeneralNote::IGESDimen_ToolNewGeneralNote ()    {  }


void  IGESDimen_ToolNewGeneralNote::ReadOwnParams
  (const Handle(IGESDimen_NewGeneralNote)& ent,
   const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
{ 
  //Standard_Boolean st; //szv#4:S4163:12Mar99 moved down

  Standard_Integer nbval;
  Standard_Real width; 
  Standard_Real height; 
  Standard_Integer justifyCode;
  gp_XYZ areaLoc; 
  Standard_Real areaRotationAngle; 
  gp_XYZ baseLinePos;
  Standard_Real normalInterlineSpace; 
  Handle(TColStd_HArray1OfInteger) charDisplays;
  Handle(TColStd_HArray1OfReal) charWidths; 
  Handle(TColStd_HArray1OfReal) charHeights; 
  Handle(TColStd_HArray1OfReal) interCharSpaces;
  Handle(TColStd_HArray1OfReal) interlineSpaces; 
  Handle(TColStd_HArray1OfInteger) fontStyles;
  Handle(TColStd_HArray1OfReal) charAngles; 
  Handle(Interface_HArray1OfHAsciiString) controlCodeStrings;
  Handle(TColStd_HArray1OfInteger) nbChars; 
  Handle(TColStd_HArray1OfReal) boxWidths; 
  Handle(TColStd_HArray1OfReal) boxHeights;
  Handle(TColStd_HArray1OfInteger) charSetCodes; 
  Handle(IGESData_HArray1OfIGESEntity) charSetEntities;
  Handle(TColStd_HArray1OfReal) slantAngles; 
  Handle(TColStd_HArray1OfReal) rotationAngles;
  Handle(TColStd_HArray1OfInteger) mirrorFlags; 
  Handle(TColStd_HArray1OfInteger) rotateFlags;
  Handle(TColgp_HArray1OfXYZ) startPoints; 
  Handle(Interface_HArray1OfHAsciiString) texts;

  //szv#4:S4163:12Mar99 `st=` not needed
  PR.ReadReal(PR.Current(), "Text Width", width);
  PR.ReadReal(PR.Current(), "Text Height", height);
  PR.ReadInteger(PR.Current(), "Justification Code", justifyCode);
  PR.ReadXYZ(PR.CurrentList(1, 3), "Area Location Point", areaLoc);
  PR.ReadReal(PR.Current(), "Area Rotation Angle", areaRotationAngle);
  PR.ReadXYZ(PR.CurrentList(1, 3), "Base Line Position", baseLinePos);
  PR.ReadReal(PR.Current(),"NormalInterline Spacing",normalInterlineSpace);

  Standard_Boolean st = PR.ReadInteger(PR.Current(), "Number of Text Strings", nbval);
  if (st && nbval > 0)
    {
      charDisplays         = new TColStd_HArray1OfInteger(1, nbval);
      charWidths           = new TColStd_HArray1OfReal(1, nbval);
      charHeights          = new TColStd_HArray1OfReal(1, nbval);
      interCharSpaces      = new TColStd_HArray1OfReal(1, nbval);
      interlineSpaces      = new TColStd_HArray1OfReal(1, nbval);
      fontStyles           = new TColStd_HArray1OfInteger(1, nbval);
      charAngles           = new TColStd_HArray1OfReal(1, nbval);
      controlCodeStrings   = new Interface_HArray1OfHAsciiString(1, nbval);
      nbChars              = new TColStd_HArray1OfInteger(1, nbval);
      boxWidths            = new TColStd_HArray1OfReal(1, nbval);
      boxHeights           = new TColStd_HArray1OfReal(1, nbval);
      charSetCodes         = new TColStd_HArray1OfInteger(1, nbval);
      charSetEntities      = new IGESData_HArray1OfIGESEntity(1,nbval);
      slantAngles          = new TColStd_HArray1OfReal(1, nbval);
      rotationAngles       = new TColStd_HArray1OfReal(1, nbval);
      mirrorFlags          = new TColStd_HArray1OfInteger(1, nbval);
      rotateFlags          = new TColStd_HArray1OfInteger(1, nbval);
      startPoints          = new TColgp_HArray1OfXYZ(1, nbval);
      texts                = new Interface_HArray1OfHAsciiString(1, nbval);
    }
  else  PR.AddFail("Number of Text Strings: Not Positive");

  if (! charDisplays.IsNull())
    for (Standard_Integer i = 1; i <= nbval; i++)
      {
	Standard_Integer charDisplay;
	Standard_Real charWidth;
	Standard_Real charHeight;
	Standard_Real interCharSpace;
	Standard_Real interlineSpace;
	Standard_Integer fontStyle;
	Standard_Real charAngle;
	Handle(TCollection_HAsciiString) controlCodeString;
	Standard_Integer nbChar;
	Standard_Real boxWidth;
	Standard_Real boxHeight;
	Standard_Integer charSetCode;
	Handle(IGESData_IGESEntity) charSetEntity;
	Standard_Real slantAngle;
	Standard_Real rotationAngle;
	Standard_Integer mirrorFlag;
	Standard_Integer rotateFlag;
	gp_XYZ startPoint;
	Handle(TCollection_HAsciiString) text;

	//st = PR.ReadInteger(PR.Current(), "Character Display",charDisplay); //szv#4:S4163:12Mar99 moved in if
	if (PR.ReadInteger(PR.Current(), "Character Display",charDisplay))
	  charDisplays->SetValue(i, charDisplay);

	//st = PR.ReadReal(PR.Current(), "Character Width", charWidth); //szv#4:S4163:12Mar99 moved in if
	if (PR.ReadReal(PR.Current(), "Character Width", charWidth))
	  charWidths->SetValue(i, charWidth);

	//st = PR.ReadReal(PR.Current(), "Character Height", charHeight); //szv#4:S4163:12Mar99 moved in if
	if (PR.ReadReal(PR.Current(), "Character Height", charHeight))
	  charHeights->SetValue(i, charHeight);

	//st = PR.ReadReal(PR.Current(), "Inter-character space", interCharSpace); //szv#4:S4163:12Mar99 moved in if
	if (PR.ReadReal(PR.Current(), "Inter-character space", interCharSpace))
	  interCharSpaces->SetValue(i, interCharSpace);

	//st = PR.ReadReal(PR.Current(), "Interline space", interlineSpace); //szv#4:S4163:12Mar99 moved in if
	if (PR.ReadReal(PR.Current(), "Interline space", interlineSpace))
	  interlineSpaces->SetValue(i, interlineSpace);

	//st = PR.ReadInteger(PR.Current(), "Font Style", fontStyle); //szv#4:S4163:12Mar99 moved in if
	if (PR.ReadInteger(PR.Current(), "Font Style", fontStyle))
	  fontStyles->SetValue(i, fontStyle);

	//st = PR.ReadReal(PR.Current(), "Character Angle", charAngle); //szv#4:S4163:12Mar99 moved in if
	if (PR.ReadReal(PR.Current(), "Character Angle", charAngle))
	  charAngles->SetValue(i, charAngle);

	//st = PR.ReadText(PR.Current(),"Control Code String", controlCodeString); //szv#4:S4163:12Mar99 moved in if
	if (PR.ReadText(PR.Current(),"Control Code String", controlCodeString))
	  controlCodeStrings->SetValue(i, controlCodeString);

	//st = PR.ReadInteger(PR.Current(), "Number of Characters", nbChar); //szv#4:S4163:12Mar99 moved in if
	if (PR.ReadInteger(PR.Current(), "Number of Characters", nbChar))
	  nbChars->SetValue(i, nbChar);

	//st = PR.ReadReal(PR.Current(), "Box Width", boxWidth); //szv#4:S4163:12Mar99 moved in if
	if (PR.ReadReal(PR.Current(), "Box Width", boxWidth))
	  boxWidths->SetValue(i, boxWidth);

	//st = PR.ReadReal(PR.Current(), "Box Height", boxHeight); //szv#4:S4163:12Mar99 moved in if
	if (PR.ReadReal(PR.Current(), "Box Height", boxHeight))
	  boxHeights->SetValue(i, boxHeight);

	Standard_Integer curnum = PR.CurrentNumber();
	if (PR.DefinedElseSkip())
	  {
	    // Reading fontCode(Integer, must be positive)
	    PR.ReadInteger(PR.Current(), "Character Set Interpretation Code",charSetCode); //szv#4:S4163:12Mar99 `st=` not needed
	    // Reading charSetEnt
	    if (charSetCode < 0) {
	      charSetEntity = PR.ParamEntity (IR,curnum);
	      if (charSetEntity.IsNull())
		PR.AddFail("Char Set Interpretation Entity : incorrect reference");
	      charSetEntities->SetValue(i, charSetEntity);
	      charSetCodes->SetValue(i, -1);
	    } else {
	      charSetCodes->SetValue(i, charSetCode);
	    }
	  }

	else
	  charSetCodes->SetValue(i, 1);

	if (PR.DefinedElseSkip())
          {
	    //st = PR.ReadReal(PR.Current(), "Slant Angle", slantAngle); //szv#4:S4163:12Mar99 moved in if
	    if (PR.ReadReal(PR.Current(), "Slant Angle", slantAngle))
	      slantAngles->SetValue(i, slantAngle);
          }
	else
	  slantAngles->SetValue(i, PI/2);

	//st = PR.ReadReal(PR.Current(), "Rotation Angle", rotationAngle); //szv#4:S4163:12Mar99 moved in if
	if (PR.ReadReal(PR.Current(), "Rotation Angle", rotationAngle))
	  rotationAngles->SetValue(i, rotationAngle);

	//st = PR.ReadInteger(PR.Current(), "Mirror Flag", mirrorFlag); //szv#4:S4163:12Mar99 moved in if
	if (PR.ReadInteger(PR.Current(), "Mirror Flag", mirrorFlag))
	  mirrorFlags->SetValue(i, mirrorFlag);

	//st = PR.ReadInteger(PR.Current(), "Rotate Flag", rotateFlag); //szv#4:S4163:12Mar99 moved in if
	if (PR.ReadInteger(PR.Current(), "Rotate Flag", rotateFlag))
	  rotateFlags->SetValue(i, rotateFlag);

	//st = PR.ReadXYZ(PR.CurrentList(1, 3), "Start Point", startPoint); //szv#4:S4163:12Mar99 moved in if
	if (PR.ReadXYZ(PR.CurrentList(1, 3), "Start Point", startPoint))
	  startPoints->SetValue(i, startPoint);

	//st = PR.ReadText(PR.Current(), "Text String", text); //szv#4:S4163:12Mar99 moved in if
	if (PR.ReadText(PR.Current(), "Text String", text))
	  texts->SetValue(i, text);
      }

  DirChecker(ent).CheckTypeAndForm(PR.CCheck(),ent);
  ent->Init
    ( width, height, justifyCode, areaLoc, areaRotationAngle,baseLinePos,
     normalInterlineSpace, charDisplays, charWidths, charHeights, 
     interCharSpaces, interlineSpaces, fontStyles, charAngles, 
     controlCodeStrings, nbChars, boxWidths, boxHeights, charSetCodes, 
     charSetEntities, slantAngles, rotationAngles, mirrorFlags, rotateFlags,
     startPoints, texts);
}

void  IGESDimen_ToolNewGeneralNote::WriteOwnParams
  (const Handle(IGESDimen_NewGeneralNote)& ent, IGESData_IGESWriter& IW) const 
{ 
  IW.Send(ent->TextWidth());
  IW.Send(ent->TextHeight());
  IW.Send(ent->JustifyCode());
  IW.Send(ent->AreaLocation().X());
  IW.Send(ent->AreaLocation().Y());
  IW.Send(ent->AreaLocation().Z());
  IW.Send(ent->AreaRotationAngle());
  IW.Send(ent->BaseLinePosition().X());
  IW.Send(ent->BaseLinePosition().Y());
  IW.Send(ent->BaseLinePosition().Z());
  IW.Send(ent->NormalInterlineSpace());
  Standard_Integer nbval = ent->NbStrings();
  IW.Send(nbval);

  for (Standard_Integer i = 1; i <= nbval; i++)
    {
      IW.Send(ent->CharacterDisplay(i));
      IW.Send(ent->CharacterWidth(i));
      IW.Send(ent->CharacterHeight(i));
      IW.Send(ent->InterCharacterSpace(i));
      IW.Send(ent->InterlineSpace(i));
      IW.Send(ent->FontStyle(i));
      IW.Send(ent->CharacterAngle(i));
      IW.Send(ent->ControlCodeString(i));
      IW.Send(ent->NbCharacters(i));
      IW.Send(ent->BoxWidth(i));
      IW.Send(ent->BoxHeight(i));
      if (ent->IsCharSetEntity(i))
	IW.Send(ent->CharSetEntity(i),Standard_True);  // negative
      else
	IW.Send(ent->CharSetCode(i));
      IW.Send(ent->SlantAngle(i));
      IW.Send(ent->RotationAngle(i));
      IW.Send(ent->MirrorFlag(i));
      IW.Send(ent->RotateFlag(i));
      IW.Send((ent->StartPoint(i)).X());
      IW.Send((ent->StartPoint(i)).Y());
      IW.Send((ent->StartPoint(i)).Z());
      IW.Send(ent->Text(i));
    }
}

void  IGESDimen_ToolNewGeneralNote::OwnShared
  (const Handle(IGESDimen_NewGeneralNote)& ent, Interface_EntityIterator& iter) const
{
  Standard_Integer nbval = ent->NbStrings();
  for (Standard_Integer i = 1; i <= nbval; i++)
    {

      if (ent->IsCharSetEntity(i))
	iter.GetOneItem(ent->CharSetEntity(i));
    }
}

void  IGESDimen_ToolNewGeneralNote::OwnCopy
  (const Handle(IGESDimen_NewGeneralNote)& another,
   const Handle(IGESDimen_NewGeneralNote)& ent, Interface_CopyTool& TC) const
{
  Standard_Real    width                = another->TextWidth();
  Standard_Real    height               = another->TextHeight();
  Standard_Integer justifyCode          = another->JustifyCode();
  gp_XYZ           areaLoc              = (another->AreaLocation()).XYZ();
  Standard_Real    areaRotationAngle    = another->AreaRotationAngle();
  gp_XYZ           baseLinePos          = (another->BaseLinePosition()).XYZ();
  Standard_Real    normalInterlineSpace = another->NormalInterlineSpace();
  Standard_Integer nbval                = another->NbStrings();

  Handle(TColStd_HArray1OfInteger) charDisplays;
  Handle(TColStd_HArray1OfReal) charWidths; 
  Handle(TColStd_HArray1OfReal) charHeights; 
  Handle(TColStd_HArray1OfReal) interCharSpaces;
  Handle(TColStd_HArray1OfReal) interlineSpaces; 
  Handle(TColStd_HArray1OfInteger) fontStyles;
  Handle(TColStd_HArray1OfReal) charAngles; 
  Handle(Interface_HArray1OfHAsciiString) controlCodeStrings;
  Handle(TColStd_HArray1OfInteger) nbChars;
  Handle(TColStd_HArray1OfReal) boxWidths; 
  Handle(TColStd_HArray1OfReal) boxHeights;
  Handle(TColStd_HArray1OfInteger) charSetCodes; 
  Handle(IGESData_HArray1OfIGESEntity) charSetEntities;
  Handle(TColStd_HArray1OfReal) slantAngles; 
  Handle(TColStd_HArray1OfReal) rotationAngles;
  Handle(TColStd_HArray1OfInteger) mirrorFlags; 
  Handle(TColStd_HArray1OfInteger) rotateFlags;
  Handle(TColgp_HArray1OfXYZ) startPoints; 
  Handle(Interface_HArray1OfHAsciiString) texts; 

  charDisplays         = new TColStd_HArray1OfInteger(1, nbval);
  charWidths           = new TColStd_HArray1OfReal   (1, nbval);
  charHeights          = new TColStd_HArray1OfReal   (1, nbval);
  interCharSpaces      = new TColStd_HArray1OfReal   (1, nbval);
  interlineSpaces      = new TColStd_HArray1OfReal   (1, nbval);
  fontStyles           = new TColStd_HArray1OfInteger(1, nbval);
  charAngles           = new TColStd_HArray1OfReal   (1, nbval);
  controlCodeStrings   = new Interface_HArray1OfHAsciiString(1, nbval);
  nbChars              = new TColStd_HArray1OfInteger(1, nbval);
  boxWidths            = new TColStd_HArray1OfReal   (1, nbval);
  boxHeights           = new TColStd_HArray1OfReal   (1, nbval);
  charSetCodes         = new TColStd_HArray1OfInteger(1, nbval);
  charSetEntities      = new IGESData_HArray1OfIGESEntity(1, nbval);
  slantAngles          = new TColStd_HArray1OfReal   (1, nbval);
  rotationAngles       = new TColStd_HArray1OfReal   (1, nbval);
  mirrorFlags          = new TColStd_HArray1OfInteger(1, nbval);
  rotateFlags          = new TColStd_HArray1OfInteger(1, nbval);
  startPoints          = new TColgp_HArray1OfXYZ     (1, nbval);
  texts                = new Interface_HArray1OfHAsciiString(1, nbval);

  for (Standard_Integer i = 1; i <= nbval; i++)
    {
      charDisplays->SetValue    (i, another->CharacterDisplay(i));
      charWidths->SetValue      (i, another->CharacterWidth(i));
      charHeights->SetValue     (i, another->CharacterHeight(i));
      interCharSpaces->SetValue (i, another->InterCharacterSpace(i));
      interlineSpaces->SetValue (i, another->InterlineSpace(i));
      fontStyles->SetValue      (i, another->FontStyle(i));
      charAngles->SetValue      (i, another->CharacterAngle(i));
      controlCodeStrings->SetValue
	(i, new TCollection_HAsciiString(another->ControlCodeString(i)));
      nbChars->SetValue         (i, another->NbCharacters(i));
      boxWidths->SetValue       (i, another->BoxWidth(i));
      boxHeights->SetValue      (i, another->BoxHeight(i));

      if (another->IsCharSetEntity(i)) {
	DeclareAndCast(IGESData_IGESEntity, charSetEntity,
		       TC.Transferred(another->CharSetEntity(i)));
	charSetEntities->SetValue(i, charSetEntity);
      }
      else  charSetCodes->SetValue(i, another->CharSetCode(i));

      slantAngles->SetValue     (i, another->SlantAngle(i));
      rotationAngles->SetValue  (i, another->RotationAngle(i));
      mirrorFlags->SetValue     (i, another->MirrorFlag(i));
      rotateFlags->SetValue     (i, another->RotateFlag(i));
      startPoints->SetValue     (i, another->StartPoint(i).XYZ());
      texts->SetValue
	 (i, new TCollection_HAsciiString(another->Text(i)));
    }

  ent->Init (width, height, justifyCode, areaLoc, areaRotationAngle, baseLinePos,
	     normalInterlineSpace, charDisplays, charWidths, charHeights, 
	     interCharSpaces, interlineSpaces, fontStyles, charAngles, 
	     controlCodeStrings,nbChars, boxWidths, boxHeights, charSetCodes,
	     charSetEntities, slantAngles, rotationAngles, mirrorFlags,
	     rotateFlags, startPoints, texts);
  
}

IGESData_DirChecker  IGESDimen_ToolNewGeneralNote::DirChecker
  (const Handle(IGESDimen_NewGeneralNote)& /* ent */ ) const 
{ 
  IGESData_DirChecker DC (213, 0);
  DC.Structure(IGESData_DefVoid);
  DC.LineFont(IGESData_DefValue);
  DC.LineWeight(IGESData_DefValue);
  DC.Color(IGESData_DefAny);
  DC.UseFlagRequired(1);
  DC.HierarchyStatusIgnored();
  return DC;
}

void  IGESDimen_ToolNewGeneralNote::OwnCheck
  (const Handle(IGESDimen_NewGeneralNote)& ent,
   const Interface_ShareTool& , Handle(Interface_Check)& ach) const 
{

  Standard_Integer jcode = ent->JustifyCode();
  if ((jcode < 0) || (jcode > 3))
    ach->AddFail("Justify Code != 0, 1, 2, 3");
  Standard_Integer upper = ent->NbStrings();
  for (Standard_Integer i = 1; i <= upper; i ++)
    {
      if (ent->NbCharacters(i) != ent->Text(i)->Length())
	{
	  char mess[80];
	  sprintf(mess,"%d : Number of Characters != Length of Text String",i);
          ach->AddFail(mess);
	}

      Standard_Integer charcode = ent->CharSetCode(i);
      if ( (charcode >= 0) && (charcode != 1) &&
	  ((charcode < 1001) || (charcode > 1003)))
	{
	  char mess[80];
	  sprintf(mess, "%d : Character Set Code != 1, 1001, 1002, 1003",i);
          ach->AddFail(mess);
	}

      Standard_Integer chardisp = ent->CharacterDisplay(i);
      if ((chardisp < 0) || (chardisp > 1))
	{
	  char mess[80];
	  sprintf(mess, "%d : Character Display != 0, 1",i);
          ach->AddFail(mess);
	}

      Standard_Integer mflag = ent->MirrorFlag(i);
      if ((mflag < 0) || (mflag > 2))
	{
	  char mess[80];
	  sprintf(mess, "%d : Mirror flag != 0, 1, 2",i);
          ach->AddFail(mess);
	}

      Standard_Integer rflag = ent->RotateFlag(i);
      if ((rflag < 0) || (rflag > 1))
	{
	  char mess[80];
	  sprintf(mess, "%d : Rotate flag != 0, 1",i);
	  ach->AddFail(mess);
	}
    }
}

void  IGESDimen_ToolNewGeneralNote::OwnDump
  (const Handle(IGESDimen_NewGeneralNote)& ent, const IGESData_IGESDumper& dumper,
   const Handle(Message_Messenger)& S, const Standard_Integer level) const 
{ 
  Standard_Integer sublevel = (level > 4) ? 1 : 0;
  Standard_Integer nbval = ent->NbStrings();

  S << "IGESDimen_NewGeneralNote" << endl;
  S << "Text Area  : Width : " << ent->TextWidth() << "  ";
  S << "Height : " << ent->TextHeight() << "  ";
  S << "Justification Code  : " << ent->JustifyCode() << endl;
  S << "Text Area Location Point : ";
  IGESData_DumpXYZL(S,level, ent->AreaLocation(), ent->Location());
  S << "Rotation Angle of Text : " << ent->AreaRotationAngle() << endl;
  S << "Base Line Position : ";
  IGESData_DumpXYZL(S,level, ent->BaseLinePosition(), ent->Location());
  S << "Normal Interline Spacing : " << ent->NormalInterlineSpace() << endl;
  S << "Number of Text Strings : " << nbval << endl;

  S << "Character Display : " << endl; 
  S << "Character Width : " << endl; 
  S << "Character Height : " << endl; 
  S << "Inter Character Spacing : " << endl; 
  S << "Interline Spacing : " << endl; 
  S << "Font Styles : " << endl; 
  S << "Character Angle : " << endl; 
  S << "Control Code String : " << endl; 
  S << "Number of Characters : " << endl; 
  S << "Box Widths : " << endl; 
  S << "Box Heights : " << endl; 
  S << "Character Set Codes : " << endl; 
  S << "Character Set Entities : " << endl; 
  S << "Slant Angles : " << endl; 
  S << "Rotation Angles : " << endl; 
  S << "Mirror Flags : " << endl; 
  S << "Rotate Flags : " << endl; 
  S << "Start Points : " << endl; 
  S << "Texts : "; 
  IGESData_DumpVals(S,-level,1, nbval, ent->NbCharacters);
  S << endl;
  if (level > 4)
    {
      S << "Details of each String" << endl;
      for ( Standard_Integer i = 1; i <= nbval; i++)
	{
          S << "[" << i << "]: " << endl;
          S << "Character Display : " << ent->CharacterDisplay(i) << "  ";
          S << "Character Width   : " << ent->CharacterWidth(i)   << "  ";
          S << "Character Height  : " << ent->CharacterHeight(i)  << endl;
          S << "Inter Character Spacing : "<<ent->InterCharacterSpace(i)<<"  ";
          S << "Interline Spacing : " << ent->InterlineSpace(i) << endl;
          S << "Font Styles       : " << ent->FontStyle(i) << endl;
          S << "Character Angle   : " << ent->CharacterAngle(i) << endl;
          S << "Control Code String : " ;
          IGESData_DumpString(S,ent->ControlCodeString(i));
          S << endl;
          S << "Number of Characters : " << ent->NbCharacters(i) << "  ";
          S << "Box Width  : " << ent->BoxWidth(i)  << "  ";
          S << "Box Height : " << ent->BoxHeight(i) << endl;
          if (ent->IsCharSetEntity(i))
	    {
              S << "Character Set Entity : ";
              dumper.Dump (ent->CharSetEntity(i),S, sublevel);
              S << endl;
	    }
          else
	    S << "Character Set Code : " << ent->CharSetCode(i) << endl;

          S << "Slant Angle : "    << ent->SlantAngle(i) << "  ";
          S << "Rotation Angle : " << ent->RotationAngle(i) << "  ";
          S << "Mirror Flag : "    << ent->MirrorFlag(i) << "  ";
          S << "Rotate Flag : "    << ent->RotateFlag(i) << endl;
          S << "Start Point : ";
          IGESData_DumpXYZL(S,level, ent->StartPoint(i), ent->Location());
          S << "Text : ";
          IGESData_DumpString(S,ent->Text(i));
          S << endl;
	}
    }
  else S << endl;
}