BOpcodeHandler.h
Go to the documentation of this file.
1 // Copyright (c) Tech Soft 3D, Inc.
2 //
3 // The information contained herein is confidential and proprietary to Tech Soft 3D, Inc.,
4 // and considered a trade secret as defined under civil and criminal statutes.
5 // Tech Soft 3D, Inc. shall pursue its civil and criminal remedies in the event of
6 // unauthorized use or misappropriation of its trade secrets. Use of this information
7 // by anyone other than authorized employees of Tech Soft 3D, Inc. is granted only under
8 // a written non-disclosure agreement, expressly prescribing the scope and manner of such use.
9 
10 #ifndef BOPCODE_HANDLER
11 #define BOPCODE_HANDLER
12 
13 #ifndef BBINFILETK_TOOLKIT
14  #include "BStreamFileToolkit.h"
15 #endif
16 
17 #ifndef POINTER_SIZED_INT
18 #if defined(WIN64) || defined(_M_X64) || defined(_WIN64)
19 # define POINTER_SIZED_INT __int64
20 # define POINTER_SIZED_UINT unsigned __int64
21 #else
22 # define POINTER_SIZED_INT long
23 # define POINTER_SIZED_UINT unsigned long
24 #endif
25 #endif
26 
27 #include "BOpcodeEnums.h"
28 
29 
31 
34 
55 class BBINFILETK_API2 BBaseOpcodeHandler
56 #ifdef HPS_CORE_BUILD
57  : public CMO
58 #else
60 #endif
61 {
62  protected:
63  int m_stage;
64  int m_progress;
65  unsigned char m_opcode;
66  unsigned char m_general_flags;
67  bool m_needs_tag;
69 
71  char * m_debug_string;
73  char * m_ascii_buffer;
74  int m_ascii_size;
75  int m_ascii_length;
76 
77  int m_ascii_stage;
79 
80  unsigned char m_byte;
81  unsigned short m_unsigned_short;
82  int m_int;
83  char m_char;
84 
85  public:
92  : m_stage (0), m_progress (0), m_opcode ((unsigned char)op), m_general_flags(0), m_needs_tag (false),
93  m_collection_part(false), m_debug_allocated (0), m_debug_string (0),
94  m_ascii_buffer (0), m_ascii_size (0), m_ascii_length (0), m_ascii_stage (0), m_ascii_progress(0),
95  m_byte(0), m_unsigned_short(0), m_int(0), m_char('\0')
96  {}
97  virtual ~BBaseOpcodeHandler ();
98 
106  virtual TK_Status Read (BStreamFileToolkit & tk) = 0;
107 
115  virtual TK_Status Write (BStreamFileToolkit & tk) = 0;
116 
124  virtual TK_Status Execute (BStreamFileToolkit & tk);
125 
135  virtual TK_Status Interpret (BStreamFileToolkit & tk, ID_Key key, int variant = 0);
136 
146  virtual TK_Status Interpret (BStreamFileToolkit & tk, ID_Key key, char const * special);
147 
153  virtual void Reset ();
154 
159  virtual bool Match_Instance (BStreamFileToolkit const & tk, Recorded_Instance * instance);
160 
161 
163  unsigned char Opcode () const { return m_opcode; }
164 
166  unsigned char General_Flags () const { return m_general_flags; }
167 
169  void Set_General_Flags (int f) { m_general_flags = (unsigned char)f; }
170 
175  int Pass (BStreamFileToolkit & tk) const { return tk.pass(); }
176 
181  TK_Status Tag (BStreamFileToolkit & tk, int variant= -1) const { return tk.tag(variant); }
182 
186  bool Tagging (BStreamFileToolkit & tk) const {
187  return m_needs_tag || tk.GetWriteFlags(TK_Force_Tags) != 0;
188  }
189 
193  void SetNeedsTag (bool n) { m_needs_tag = n; }
194 
198  bool NeedsTag () const { return m_needs_tag; }
199 
203  void SetCollectionPart(bool n) { m_collection_part = n; }
204 
208  bool IsCollectionPart() const { return m_collection_part; }
209 
216  virtual TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const {
217  *handler = 0;
218  return tk.Error();
219  }
220 
226  virtual bool NeedsContext (BStreamFileToolkit & tk) const { (void)tk; return false; }
227 
232  void SetLoggingString (char const * segment);
233 
238  void SetLoggingString (int length);
239 
243  char const * GetLoggingString () const { return m_debug_string; }
248  char * GetLoggingString () { return m_debug_string; }
249 
253  void LogDebug (BStreamFileToolkit & tk, char const * string = 0);
254 
255  protected:
256  // various means of pulling data from the toolkit buffer
257  // Note: format conversion is safe to do in output buffer
258 
260  static TK_Status GetData (BStreamFileToolkit & tk, char * b, int n) { return tk.read (b, n); }
261 
263  static TK_Status GetData (BStreamFileToolkit & tk, short * s, int n) {
264  TK_Status status;
265  if ((status = GetData (tk, (char *)s, n * (int)sizeof (short))) == TK_Normal)
266  fix (s, n);
267  return status;
268  }
269 
271  static TK_Status GetData (BStreamFileToolkit & tk, int * i, int n) {
272  TK_Status status;
273  if ((status = GetData (tk, (char *)i, n * (int)sizeof (int))) == TK_Normal)
274  fix (i, n);
275  return status;
276  }
277 
279  static TK_Status GetData (BStreamFileToolkit & tk, float * f, int n) {
280  TK_Status status;
281  if ((status = GetData (tk, (char *)f, n * (int)sizeof (float))) == TK_Normal)
282  fix_in (f, n);
283  return status;
284  }
285 
287  static TK_Status GetData (BStreamFileToolkit & tk, double * d, int n) {
288  TK_Status status;
289  if ((status = GetData (tk, (char *)d, n * (int)sizeof (double))) == TK_Normal)
290  fix_in (d, n);
291  return status;
292  }
293 
295  static TK_Status GetData (BStreamFileToolkit & tk, unsigned char * b, int n) { return GetData (tk, (char *)b, n); }
296 
298  static TK_Status GetData (BStreamFileToolkit & tk, unsigned short * s, int n) { return GetData (tk, (short *)s, n); }
299 
301  static TK_Status GetData (BStreamFileToolkit & tk, unsigned int * i, int n) { return GetData (tk, (int *)i, n); }
302 
304  static TK_Status GetData (BStreamFileToolkit & tk, char & c) { return GetData (tk, &c, 1); }
305 
307  static TK_Status GetData (BStreamFileToolkit & tk, short & s) { return GetData (tk, &s, 1); }
308 
310  static TK_Status GetData (BStreamFileToolkit & tk, int & i) { return GetData (tk, &i, 1); }
311 
313  static TK_Status GetData (BStreamFileToolkit & tk, unsigned char & b) { return GetData (tk, &b, 1); }
314 
316  static TK_Status GetData (BStreamFileToolkit & tk, unsigned short & s) { return GetData (tk, &s, 1); }
317 
319  static TK_Status GetData (BStreamFileToolkit & tk, unsigned int & i) { return GetData (tk, &i, 1); }
320 
322  static TK_Status GetData (BStreamFileToolkit & tk, float & f) { return GetData (tk, &f, 1); }
323 
325  static TK_Status GetData (BStreamFileToolkit & tk, double & d) { return GetData (tk, &d, 1); }
326 
327 
330  TK_Status status = TK_Normal;
331 
332  if (tk.GetVersion() >= 1975 &&
333  (status = GetData (tk, m_general_flags)) != TK_Normal)
334  return status;
335 
336  return status;
337  }
338 
339 
340 
341 
343  static TK_Status LookatData (BStreamFileToolkit & tk, unsigned char & b) { return tk.lookat ((char &)b); }
344 
345  // various means of putting data into the toolkit buffer
346  // Note: format conversion is NOT safe in input buffer -- use temps
347 
349  static TK_Status PutData (BStreamFileToolkit & tk, char const * b, int n) { return tk.write (b, n); }
350 
352  static TK_Status PutData (BStreamFileToolkit & tk, short const * s, int n) {
353  #ifdef STREAM_BIGENDIAN
354  short * buffer;
355  short * tmp;
356  TK_Status status;
357  int i;
358  BSTREAM_ALLOC_ARRAY(buffer, n, short);
359  tmp = buffer;
360  for (i=0; i<n; ++i)
361  *tmp++ = flip (*s++);
362  status = PutData (tk, (char const *)buffer, n * (int)sizeof (short));
363  BSTREAM_FREE_ARRAY(buffer, n, short);
364  if (status != TK_Normal)
365  return status;
366  return TK_Normal;
367  #else
368  return PutData (tk, (char const *)s, n * (int)sizeof (short));
369  #endif
370  }
371 
373  static TK_Status PutData (BStreamFileToolkit & tk, int const * i, int n) {
374  #ifdef STREAM_BIGENDIAN
375  int * buffer;
376  int * tmp;
377  TK_Status status;
378  int j;
379  BSTREAM_ALLOC_ARRAY(buffer, n, int);
380  tmp = buffer;
381  for (j=0; j<n; ++j)
382  *tmp++ = flip (*i++);
383  status = PutData (tk, (char const *)buffer, n * (int)sizeof (int));
384  BSTREAM_FREE_ARRAY(buffer, n, int);
385  if (status != TK_Normal)
386  return status;
387  return TK_Normal;
388  #else
389  return PutData (tk, (char const *)i, n * (int)sizeof (int));
390  #endif
391  }
392 
394  static TK_Status PutData (BStreamFileToolkit & tk, float const * f, int n) {
395  #if defined(NON_IEEE) || defined(STREAM_BIGENDIAN)
396  float * buffer;
397  float * tmp;
398  TK_Status status;
399  int i;
400  BSTREAM_ALLOC_ARRAY(buffer, n, float);
401  tmp = buffer;
402  for (i=0; i<n; ++i) {
403  *tmp = *f++;
404  fix_out (tmp++, 1);
405  }
406  status = PutData (tk, (char const *)buffer, n * (int)sizeof (float));
407  BSTREAM_FREE_ARRAY(buffer, n, float);
408  if (status != TK_Normal)
409  return status;
410  return TK_Normal;
411  #else
412  return PutData (tk, (char const *)f, n * (int)sizeof (float));
413  #endif
414  }
415 
417  static TK_Status PutData (BStreamFileToolkit & tk, double const * d, int n) {
418  #if defined(NON_IEEE) || defined(STREAM_BIGENDIAN)
419  double * buffer;
420  double * tmp;
421  TK_Status status;
422  int i;
423  BSTREAM_ALLOC_ARRAY(buffer, n, double);
424  tmp = buffer;
425  for (i=0; i<n; ++i) {
426  *tmp = *d++;
427  fix_out (tmp++, 1);
428  }
429  status = PutData (tk, (char const *)buffer, n * (int)sizeof (double));
430  BSTREAM_FREE_ARRAY(buffer, n, double);
431  if (status != TK_Normal)
432  return status;
433  return TK_Normal;
434  #else
435  return PutData (tk, (char const *)d, n * (int)sizeof (double));
436  #endif
437  }
438 
440  static TK_Status PutData (BStreamFileToolkit & tk, unsigned char const * b, int n) { return PutData (tk, (char const *)b, n); }
441 
443  static TK_Status PutData (BStreamFileToolkit & tk, unsigned short const * s, int n) { return PutData (tk, (short const *)s, n); }
444 
446  static TK_Status PutData (BStreamFileToolkit & tk, unsigned int const * i, int n) { return PutData (tk, (int const *)i, n); }
447 
449  static TK_Status PutData (BStreamFileToolkit & tk, char const & c) { return PutData (tk, &c, 1); }
450 
452  static TK_Status PutData (BStreamFileToolkit & tk, short const & s) { return PutData (tk, &s, 1); }
453 
455  static TK_Status PutData (BStreamFileToolkit & tk, int const & i) { return PutData (tk, &i, 1); }
456 
458  static TK_Status PutData (BStreamFileToolkit & tk, unsigned char const & b) { return PutData (tk, &b, 1); }
459 
461  static TK_Status PutData (BStreamFileToolkit & tk, unsigned short const & s) { return PutData (tk, &s, 1); }
462 
464  static TK_Status PutData (BStreamFileToolkit & tk, unsigned int const & i) { return PutData (tk, &i, 1); }
465 
467  static TK_Status PutData (BStreamFileToolkit & tk, float const & f) { return PutData (tk, &f, 1); }
468 
470  static TK_Status PutData (BStreamFileToolkit & tk, double const & d) { return PutData (tk, &d, 1); }
471 
473  TK_Status PutOpcode (BStreamFileToolkit & tk, int adjust = 1) {
474  TK_Status status;
475  unsigned int sequence;
476 
477  if ((status = PutData (tk, Opcode ())) != TK_Normal)
478  return status;
479 
480  tk.adjust_written (adjust);
481 
482  sequence = tk.NextOpcodeSequence();
483  if (tk.GetLogging())
484  log_opcode (tk, sequence, Opcode());
485 
486  return status;
487  }
488 
491  TK_Status status = TK_Normal;
492 
493  if (tk.GetTargetVersion() >= 1975 &&
494  (status = PutData (tk, General_Flags ())) != TK_Normal)
495  return status;
496 
497  return status;
498  }
499 
500 
501 
502  /* note -- fix for int types will work during read OR write phase, but floats need separate routines for native->IEEE and IEEE->native
503  */
505  static short flip (short s) {
506  return (short)(((s >> 8) & 0x00FF) | (s << 8));
507  }
509  static int flip (int i) {
510  return ((i >> 24) & 0x000000FF) | ((i >> 8) & 0x0000FF00) |
511  ((i << 8) & 0x00FF0000) | (i << 24);
512  }
513 
514  #ifdef STREAM_BIGENDIAN
515  static void flip (double * d) {
517  char b[8];
518  memcpy (b, &d, sizeof(double));
519  Swap (b[0], b[7]);
520  Swap (b[1], b[6]);
521  Swap (b[2], b[5]);
522  Swap (b[3], b[4]);
523  memcpy (&d, b, sizeof(double));
524  }
525  #endif
526 
527 #ifndef DOXYGEN_SHOULD_SKIP_THIS
528  #ifndef UNREFERENCED
529  #define UNREFERENCED(x) (void)(x)
530  #endif
531 #endif
532 
534  static void fix (int * i, int n) {
535  #ifdef STREAM_BIGENDIAN
536  while (n--){
537  *i = flip (*i);
538  i++;
539  }
540  #else
541  UNREFERENCED(i);
542  UNREFERENCED(n);
543  #endif
544  }
546  static void fix (short * s, int n) {
547  #ifdef STREAM_BIGENDIAN
548  while (n--){
549  *s = flip (*s);
550  s++;
551  }
552  #else
553  UNREFERENCED(s);
554  UNREFERENCED(n);
555  #endif
556  }
557 
559  static void fix_in (float * f, int n) {
560  #ifdef NON_IEEE
561  // need to re-interpret from IEEE to native format
562  #endif
563 
564  #ifdef STREAM_BIGENDIAN
565  int * i = (int *) f;
566  while (n--) {
567  *i = flip (*i);
568  i++;
569  }
570  #else
571  UNREFERENCED(f);
572  UNREFERENCED(n);
573  #endif
574  }
576  static void fix_in (double * d, int n) {
577  #ifdef NON_IEEE
578  // need to re-interpret from IEEE to native format
579  #endif
580 
581  #ifdef STREAM_BIGENDIAN
582  while (n--) {
583  flip (d++);
584  }
585  #else
586  UNREFERENCED(d);
587  UNREFERENCED(n);
588  #endif
589  }
591  static void fix_out (float * f, int n) {
592  #ifdef NON_IEEE
593  // need to re-interpret from native format to IEEE
594  #endif
595 
596  #ifdef STREAM_BIGENDIAN
597  int * i = (int*) f;
598  while (n--) {
599  *i = flip (*i);
600  i++;
601  }
602  #else
603  UNREFERENCED(f);
604  UNREFERENCED(n);
605  #endif
606  }
608  static void fix_out (double * d, int n) {
609  #ifdef NON_IEEE
610  // need to re-interpret from native format to IEEE
611  #endif
612 
613  #ifdef STREAM_BIGENDIAN
614  while (n--) {
615  flip (d++);
616  }
617  #else
618  UNREFERENCED(d);
619  UNREFERENCED(n);
620  #endif
621  }
622 
624  void log_opcode (BStreamFileToolkit & tk, unsigned int sequence, unsigned char opcode);
625 
626 
627  /* common conversions
628  these two are for converting between floats [0.0,1.0] and unsigned chars [0,255]
629  */
631  void floats_to_bytes (float const * in, unsigned char * out, int count) const {
632  while (count-- > 0)
633  *out++ = char (*in++ * 255.999f);
634  }
636  void bytes_to_floats (unsigned char const * in, float * out, int count) const {
637  while (count-- > 0)
638  *out++ = float (*in++) * (1.0f/255.0f);
639  }
640 
641  // access to toolkit utility functions
643  void add_segment (BStreamFileToolkit & tk, ID_Key key) { tk.add_segment (key); }
645  ID_Key remove_segment (BStreamFileToolkit & tk) { return tk.remove_segment(); }
647  void set_last_key (BStreamFileToolkit & tk, ID_Key key) { tk.set_last_key (key); }
650  if (tk.m_last_keys_used == 1)
651  return tk.m_last_keys[0];
652  else
653  return -1;
654  }
656  void adjust_written (BStreamFileToolkit & tk, int count) { tk.adjust_written (count); }
658  void increase_nesting (BStreamFileToolkit & tk, int amount=1) { tk.increase_nesting (amount); }
660  void decrease_nesting (BStreamFileToolkit & tk, int amount=1) { tk.decrease_nesting (amount); }
661 
665  void Revisit (BStreamFileToolkit & tk, float priority=0.0f, int variant=0) const { tk.revisit (Opcode(), priority, variant); }
666 
670  BBaseOpcodeHandler * Opcode_Handler (BStreamFileToolkit & tk, unsigned char op) const
671  { return tk.opcode_handler (op); }
672 
674  void Record_Instance (BStreamFileToolkit & tk, ID_Key key, int variant,
675  int val1, int val2, int val3) const {
676  tk.record_instance (key, variant, this, val1, val2, val3);
677  }
679  bool Find_Instance (BStreamFileToolkit & tk, int val1, int val2, int val3) {
680  return tk.find_instance (this, val1, val2, val3);
681  }
682 
684  void Remember_Item (BStreamFileToolkit & tk, ID_Key key) const { tk.remember_item(key); }
686  bool Find_Item (BStreamFileToolkit & tk, ID_Key key) const { return tk.find_item(key); }
687 
689  bool validate_count (int count, int limit = 1<<24) const { return 0 <= count && count <= limit; }
690 
694  static float read_float (char const *cp, char const ** newcpp = 0);
696  static float read_float (char const *cp, char ** newcpp)
697  { return read_float (cp, (char const **)newcpp); }
699  static char * write_float (char * buffer, double f);
700 
701 
702 
704  TK_Status SkipNewlineAndTabs(BStreamFileToolkit & tk, unsigned int* readSize=0);
706  TK_Status ReadAsciiLine(BStreamFileToolkit & tk, unsigned int* readSize=0);
708  TK_Status ReadAsciiWord(BStreamFileToolkit & tk, unsigned int* readSize=0);
710  TK_Status ReadEndOpcode(BStreamFileToolkit & tk);
712  bool RemoveAngularBrackets(char* string);
714  bool RemoveQuotes(char* string);
716  TK_Status Read_Referenced_Segment(BStreamFileToolkit & tk, int &i_progress);
717 
718  //TK_Status GetAsciiData(BStreamFileToolkit & tk, float * rFloats, unsigned int n);
719 
721  TK_Status GetAsciiData(BStreamFileToolkit & tk, int * rInts, unsigned int n);
722  //TK_Status GetAsciiData(BStreamFileToolkit & tk, short * rShorts, unsigned int n);
723 
725  TK_Status GetAsciiData(BStreamFileToolkit & tk, const char * tag, unsigned char& value);
727  TK_Status GetAsciiData(BStreamFileToolkit & tk, const char * tag, char& value);
729  TK_Status GetAsciiData(BStreamFileToolkit & tk, const char * tag, unsigned short& value);
731  TK_Status GetAsciiData(BStreamFileToolkit & tk, const char * tag, short& value);
733  TK_Status GetAsciiData(BStreamFileToolkit & tk, const char * tag, int& value);
735  TK_Status GetAsciiData(BStreamFileToolkit & tk, const char * tag, float& value);
737  TK_Status GetAsciiData(BStreamFileToolkit & tk, const char * tag, float * rFloats, unsigned int n);
739  TK_Status GetAsciiData(BStreamFileToolkit & tk, const char * tag, char * m_string, unsigned int n);
741  TK_Status GetAsciiData(BStreamFileToolkit & tk, const char * tag, unsigned char * m_string, unsigned int n);
743  TK_Status GetAsciiData(BStreamFileToolkit & tk, const char * tag, int * rInts, unsigned int n);
745  TK_Status GetAsciiData(BStreamFileToolkit & tk, const char * tag, short * rShorts, unsigned int n);
747  TK_Status GetAsciiData(BStreamFileToolkit & tk, const char * tag, unsigned short * rShorts, unsigned int n);
749  TK_Status GetAsciiHex(BStreamFileToolkit & tk, const char * tag, unsigned char &value);
751  TK_Status GetAsciiHex(BStreamFileToolkit & tk, const char * tag, int &value);
753  TK_Status GetAsciiHex(BStreamFileToolkit & tk, const char * tag, char &value);
755  TK_Status GetAsciiHex(BStreamFileToolkit & tk, const char * tag, unsigned short &value);
757  TK_Status GetAsciiImageData(BStreamFileToolkit & tk, const char * tag, unsigned char * rValues, unsigned int n);
758 
760  TK_Status PutAsciiOpcode (BStreamFileToolkit & tk, int adjust = 1, bool is_end = false, bool want_newline = true);
761  // TK_Status PutAsciiOpcode (BStreamFileToolkit & tk, int adjust = 1);
762 
764  TK_Status PutAsciiData (BStreamFileToolkit & tk, char const *tag, char const * b, int n);
766  TK_Status PutAsciiData (BStreamFileToolkit & tk, char const *tag, short const * s, int n);
768  TK_Status PutAsciiData (BStreamFileToolkit & tk, char const *tag, int const * i, int n);
770  TK_Status PutAsciiData (BStreamFileToolkit & tk, char const *tag, float const * f, int n);
772  TK_Status PutAsciiData (BStreamFileToolkit & tk, char const *tag, unsigned char const * b, int n);
774  TK_Status PutAsciiData (BStreamFileToolkit & tk, char const *tag, unsigned short const * s, int n);
776  TK_Status PutAsciiData (BStreamFileToolkit & tk, char const *tag, unsigned int const * i, int n);
778  TK_Status PutAsciiData (BStreamFileToolkit & tk, char const *tag, char const & c);
780  TK_Status PutAsciiData (BStreamFileToolkit & tk, char const *tag, short const & s);
782  TK_Status PutAsciiData (BStreamFileToolkit & tk, char const *tag, int const & i);
784  TK_Status PutAsciiFlag (BStreamFileToolkit & tk, char const *tag, int const & i);
786  TK_Status PutAsciiData (BStreamFileToolkit & tk, char const *tag, unsigned char const & b);
788  TK_Status PutAsciiData (BStreamFileToolkit & tk, char const *tag, unsigned short const & s);
790  TK_Status PutAsciiData (BStreamFileToolkit & tk, char const *tag, unsigned int const & i);
792  TK_Status PutAsciiData (BStreamFileToolkit & tk, char const *tag, float const & f);
794  TK_Status PutAsciiMask (BStreamFileToolkit & tk,char const *tag, int const & i);
796  TK_Status PutAsciiHex (BStreamFileToolkit & tk, char const *tag, int const & i);
798  TK_Status PutStartXMLTag (BStreamFileToolkit & tk, char const *tag);
800  TK_Status PutEndXMLTag (BStreamFileToolkit & tk, char const *tag);
801 };
802 
804 #define IMPLEMENT_CLONE(class_name) \
805  TK_Status class_name::Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **newhandler) const { \
806  *newhandler = BSTREAM_NEW(class_name); \
807  if (*newhandler != nullptr) \
808  return TK_Normal; \
809  else \
810  return tk.Error ("memory allocation in" #class_name "::clone failed"); \
811  } //
812 #define IMPLEMENT_CLONE_OPCODE(class_name) \
814  TK_Status class_name::Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **newhandler) const { \
815  *newhandler = BSTREAM_NEW(class_name)(Opcode()); \
816  if (*newhandler != nullptr) \
817  return TK_Normal; \
818  else \
819  return tk.Error ("memory allocation in" #class_name "::clone failed"); \
820 } //
821 
823 
829 class BBINFILETK_API TK_Default : public BBaseOpcodeHandler {
830 
831  protected:
832  char * m_opcode_buffer;
833  int m_buffer_count;
834 
835  public:
837  TK_Default () : BBaseOpcodeHandler (TKE_Pseudo_Handler) {m_opcode_buffer = 0, m_buffer_count = 0;}
838 
840 
842 
843 
844  TK_Status ReadAscii (BStreamFileToolkit & tk);
845  TK_Status WriteAscii (BStreamFileToolkit & tk);
846 
847 };
848 
854 class BBINFILETK_API TK_Unavailable : public BBaseOpcodeHandler {
855  public:
857  TK_Unavailable (char opcode) : BBaseOpcodeHandler (opcode) {}
858 
861 };
862 
865 
871 class BBINFILETK_API TK_Header : public BBaseOpcodeHandler {
872  protected:
875 
876  public:
878  TK_Header () : BBaseOpcodeHandler (TKE_Pseudo_Handler), m_current_object (0) {}
879  ~TK_Header();
880 
883 
884 
885  TK_Status ReadAscii (BStreamFileToolkit & tk);
886  TK_Status WriteAscii (BStreamFileToolkit & tk);
887 
888 
889  void Reset ();
890 };
891 
892 
894 
900 class BBINFILETK_API TK_File_Info : public BBaseOpcodeHandler {
901  protected:
903  int m_flags;
904 
905  public:
907  TK_File_Info () : BBaseOpcodeHandler (TKE_File_Info), m_flags (0) {}
908 
909 
913  TK_Status Interpret (BStreamFileToolkit & tk, ID_Key key, int variant);
914  TK_Status Interpret (BStreamFileToolkit & tk, ID_Key key, char const * special)
915  { return BBaseOpcodeHandler::Interpret(tk, key, special); }
916 
917 
918  TK_Status ReadAscii (BStreamFileToolkit & tk);
919  TK_Status WriteAscii (BStreamFileToolkit & tk);
920 
921 
923  void SetFlags (int f) { m_flags = f; }
925  int GetFlags () { return m_flags; }
926 };
927 
928 
930 
938 class BBINFILETK_API TK_Comment : public BBaseOpcodeHandler {
939  protected:
941  int m_length;
945  char * m_comment;
946 
948  void set_comment (char const * comment);
950  void set_comment (int length);
951 
952  public:
954  TK_Comment (char const * comment = 0);
955  ~TK_Comment();
956 
960 
961  TK_Status ReadAscii (BStreamFileToolkit & tk);
962  TK_Status WriteAscii (BStreamFileToolkit & tk);
963  TK_Status ExecuteAscii (BStreamFileToolkit & tk);
966  TK_Status Interpret (BStreamFileToolkit & tk, ID_Key key, int variant) {
967  (void)tk; (void)key; (void)variant;
968  return TK_Normal;
969  }
970  TK_Status Interpret (BStreamFileToolkit & tk, ID_Key key, char const * special)
971  { return BBaseOpcodeHandler::Interpret(tk, key, special); }
972  void Reset ();
973 
978  void SetComment (char const * comment) { set_comment (comment); }
983  void SetComment (int length) { set_comment (length); }
987  char const * GetComment () const { return m_comment; }
992  char * GetComment () { return m_comment; }
993 };
994 
995 
997 
1005 class BBINFILETK_API TK_Terminator : public BBaseOpcodeHandler {
1006  public:
1008  TK_Terminator (char opcode, bool is_file_terminator = true) : BBaseOpcodeHandler (opcode),
1009  m_terminate_file(is_file_terminator) {}
1010 
1014 
1015 
1016  TK_Status ReadAscii (BStreamFileToolkit & tk);
1017  TK_Status WriteAscii (BStreamFileToolkit & tk);
1018 
1019  protected:
1021  // meant to terminate the file or something else (viz. LOD collection)
1023 };
1024 
1025 
1027 
1034 class BBINFILETK_API TK_Compression : public BBaseOpcodeHandler {
1035  public:
1037  TK_Compression (char opcode) : BBaseOpcodeHandler (opcode) {}
1038 
1041 
1042  TK_Status ReadAscii (BStreamFileToolkit & tk);
1043  TK_Status WriteAscii (BStreamFileToolkit & tk);
1045  TK_Status ExecuteAscii (BStreamFileToolkit & tk);
1046  TK_Status Interpret (BStreamFileToolkit & tk, ID_Key key, int variant);
1047  TK_Status Interpret (BStreamFileToolkit & tk, ID_Key key, char const * special)
1048  { return BBaseOpcodeHandler::Interpret(tk, key, special); }
1049 };
1050 
1052 
1053 
1054 // this should be based off a "data handling" interface class broken out from BBaseOpcodeHandler
1055 class BBINFILETK_API Lock_Masks : public BBaseOpcodeHandler {
1056  public:
1057  int mask;
1058  int value;
1099 
1100 
1101  Lock_Masks () : BBaseOpcodeHandler (0) {}
1103  TK_Status Write (BStreamFileToolkit &) { return TK_Error; } //-V524
1104 
1105  TK_Status Read (BStreamFileToolkit & tk, bool mask_only);
1106  TK_Status Write (BStreamFileToolkit & tk, bool mask_only);
1107 
1108  void init() {
1109  mask = value = 0;
1110  color_mask = color_value = 0;
1111  color_face_mask = color_face_value =
1112  color_edge_mask = color_edge_value =
1113  color_line_mask = color_line_value =
1114  color_marker_mask = color_marker_value =
1115  color_text_mask = color_text_value =
1116  color_window_mask = color_window_value =
1117  color_face_contrast_mask = color_face_contrast_value =
1118  color_window_contrast_mask = color_window_contrast_value =
1119  color_back_mask = color_back_value =
1120  color_vertex_mask = color_vertex_value =
1121  color_edge_contrast_mask = color_edge_contrast_value =
1122  color_line_contrast_mask = color_line_contrast_value =
1123  color_marker_contrast_mask = color_marker_contrast_value =
1124  color_vertex_contrast_mask = color_vertex_contrast_value =
1125  color_text_contrast_mask = color_text_contrast_value = 0;
1126  color_simple_reflection_mask = color_simple_reflection_value = 0;
1127  color_cut_face_mask = color_cut_face_value = 0;
1128  color_cut_edge_mask = color_cut_edge_value = 0;
1129  visibility_mask = visibility_value = 0;
1130  }
1131 
1132  void set_color() {
1133  color_mask = color_value = TKO_Geo_All_Colors;
1134  color_face_mask = color_face_value =
1135  color_edge_mask = color_edge_value =
1136  color_line_mask = color_line_value =
1137  color_marker_mask = color_marker_value =
1138  color_text_mask = color_text_value =
1139  color_window_mask = color_window_value =
1140  color_face_contrast_mask = color_face_contrast_value =
1141  color_window_contrast_mask = color_window_contrast_value =
1142  color_back_mask = color_back_value =
1143  color_vertex_mask = color_vertex_value =
1144  color_edge_contrast_mask = color_edge_contrast_value =
1145  color_line_contrast_mask = color_line_contrast_value =
1146  color_marker_contrast_mask = color_marker_contrast_value =
1147  color_vertex_contrast_mask = color_vertex_contrast_value =
1148  color_text_contrast_mask = color_text_contrast_value =
1149  color_simple_reflection_mask = color_simple_reflection_value =
1150  color_cut_face_mask = color_cut_face_value =
1151  color_cut_edge_mask = color_cut_edge_value =
1153  }
1154 };
1155 
1157 
1159 
1169 class BBINFILETK_API TK_Open_Segment : public BBaseOpcodeHandler {
1170  protected:
1171  int m_length;
1173  char * m_string;
1175  void set_segment (char const * segment);
1178  void set_segment (int length);
1179 
1180  public:
1182  TK_Open_Segment () : BBaseOpcodeHandler (TKE_Open_Segment), m_length (0), m_allocated (0), m_string (0) {}
1183  ~TK_Open_Segment();
1184 
1187  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
1188 
1189  TK_Status ReadAscii (BStreamFileToolkit & tk);
1190  TK_Status WriteAscii (BStreamFileToolkit & tk);
1191  void Reset ();
1192 
1197  void SetSegment (char const * segment) { set_segment (segment); }
1198 
1203  void SetSegment (int length) { set_segment (length); }
1204 
1208  char const * GetSegment () const { return m_string; }
1213  char * GetSegment () { return m_string; }
1214 
1215 };
1216 
1217 
1219 
1228 class BBINFILETK_API TK_Close_Segment : public BBaseOpcodeHandler {
1229  public:
1231  TK_Close_Segment () : BBaseOpcodeHandler (TKE_Close_Segment) {}
1232 
1235  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
1236 
1237  TK_Status ReadAscii (BStreamFileToolkit & tk);
1238  TK_Status WriteAscii (BStreamFileToolkit & tk);
1239 };
1240 
1241 
1242 
1244 
1256 class BBINFILETK_API TK_Reopen_Segment : public BBaseOpcodeHandler {
1257  protected:
1258  int m_index;
1260  public:
1262  TK_Reopen_Segment () : BBaseOpcodeHandler (TKE_Reopen_Segment), m_index (-1) {}
1263 
1266  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
1267 
1268  TK_Status ReadAscii (BStreamFileToolkit & tk);
1269  TK_Status WriteAscii (BStreamFileToolkit & tk);
1270 
1272  void SetIndex (int i) { m_index = i; }
1274  int GetIndex () const { return m_index; }
1275 };
1276 
1277 
1279 
1287 class BBINFILETK_API TK_Referenced_Segment : public BBaseOpcodeHandler {
1288  protected:
1289  int m_length;
1291  char * m_string;
1294  char * m_condition;
1298  unsigned char m_renumbered_scope;
1300  bool m_follow;
1302 
1303  bool m_referee_has_priority;
1304  int m_referee_priority;
1305 
1306  void set_segment (char const * segment);
1307  void set_segment (int length);
1308 
1309  public:
1311  TK_Referenced_Segment (unsigned char opcode);
1313 
1316  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
1317 
1318  TK_Status ReadAscii (BStreamFileToolkit & tk);
1319  TK_Status WriteAscii (BStreamFileToolkit & tk);
1320  void Reset ();
1321 
1326  void SetSegment (char const * segment) { set_segment (segment); }
1331  void SetSegment (int length) { set_segment (length); }
1335  char const * GetSegment () const { return m_string; }
1340  char * GetSegment () { return m_string; }
1341 
1342 
1347  void SetCondition (char const * condition);
1352  void SetCondition (int length);
1356  char const * GetCondition () const { return m_condition; }
1361  char * GetCondition () { return m_condition; }
1362 
1363 
1365  void SetFollow (bool f) { m_follow = f; }
1367  bool GetFollow () { return m_follow; }
1368 
1369 };
1370 
1371 
1373 
1381 class BBINFILETK_API TK_Reference : public BBaseOpcodeHandler {
1382  protected:
1383  int m_index;
1386  char * m_condition;
1391  bool m_follow;
1392 
1393  public:
1395  TK_Reference ();
1396  ~TK_Reference();
1397 
1400  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
1401 
1402  TK_Status ReadAscii (BStreamFileToolkit & tk);
1403  TK_Status WriteAscii (BStreamFileToolkit & tk);
1404  void Reset ();
1405 
1407  void SetIndex (int index) { m_index = index; }
1409  ID_Key GetIndex () { return m_index; }
1410 
1415  void SetCondition (char const * condition);
1420  void SetCondition (int length);
1424  char const * GetCondition () const { return m_condition; }
1429  char * GetCondition () { return m_condition; }
1430 
1431 
1433  void SetFollow (bool f) { m_follow = f; }
1435  bool GetFollow () { return m_follow; }
1436 };
1437 
1439 
1441 
1449 class BBINFILETK_API TK_Instance : public BBaseOpcodeHandler {
1450  protected:
1456  float m_matrix[16];
1457 
1458  public:
1460  TK_Instance (int from_index=0, int from_variant=0, int to_index=0, int to_variant=0,
1461  int options=0, float const xform[]=0);
1462 
1465  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
1466 
1467  TK_Status ReadAscii (BStreamFileToolkit & tk);
1468  TK_Status WriteAscii (BStreamFileToolkit & tk);
1469 
1470  void Reset ();
1471 };
1472 
1474 
1477 class BBINFILETK_API TK_Delete_Object : public BBaseOpcodeHandler {
1478  protected:
1479  int m_index;
1480 
1481  public:
1484 
1487  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
1488 
1489  TK_Status ReadAscii (BStreamFileToolkit & tk);
1490  TK_Status WriteAscii (BStreamFileToolkit & tk);
1491 
1493  void SetIndex (int i) { m_index = i; }
1495  int GetIndex () { return m_index; }
1496 };
1497 
1498 
1500 
1501 
1503 
1506 class BBINFILETK_API TK_LOD : public BBaseOpcodeHandler {
1507  protected:
1513  struct vlist_s *m_current_working;
1515 
1516  TK_Status ReadOneList (BStreamFileToolkit & tk);
1517 
1518  public:
1520  TK_LOD () : BBaseOpcodeHandler (TKE_LOD) {
1521  m_num_primitives = 0;
1522  m_primitives = 0;
1523  m_highest_level = 0;
1524  m_levels_allocated = 0;
1525  m_substage = 0;
1526  m_current_working = 0;
1527  m_current_level = 0;
1528  }
1529  ~TK_LOD();
1530 
1533  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
1534 
1535  TK_Status ReadAscii (BStreamFileToolkit & tk);
1536  TK_Status WriteAscii (BStreamFileToolkit & tk);
1537 
1538  void Reset ();
1539 };
1541 #define TKLOD_ESCAPE 255
1542 
1543 
1545 
1547 
1552 class BBINFILETK_API TK_Geometry_Attributes : public BBaseOpcodeHandler {
1553  protected:
1554 
1555  public:
1557  TK_Geometry_Attributes () : BBaseOpcodeHandler (TKE_Geometry_Attributes) {}
1558 
1561 
1562  TK_Status ReadAscii (BStreamFileToolkit & tk);
1563  TK_Status WriteAscii (BStreamFileToolkit & tk);
1565 };
1566 
1568 
1578 class BBINFILETK_API TK_Renumber : public BBaseOpcodeHandler {
1579  protected:
1581 
1582  public:
1586  TK_Renumber (unsigned char opcode, ID_Key key = 0) : BBaseOpcodeHandler (opcode), m_key (key) {}
1587 
1590  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
1591 
1592  TK_Status ReadAscii (BStreamFileToolkit & tk);
1593  TK_Status WriteAscii (BStreamFileToolkit & tk);
1594 
1595  void SetKey (ID_Key k) { m_key = k; }
1597  ID_Key GetKey () const { return m_key; }
1598 };
1599 
1600 
1602 
1607 class BBINFILETK_API TK_Tag : public BBaseOpcodeHandler {
1608  protected:
1609 
1610  public:
1612  TK_Tag (unsigned char opcode = TKE_Tag) : BBaseOpcodeHandler (opcode) {}
1613 
1616 
1617  TK_Status ReadAscii (BStreamFileToolkit & tk);
1618  TK_Status WriteAscii (BStreamFileToolkit & tk);
1619 
1621  TK_Status Interpret (BStreamFileToolkit & tk, ID_Key key, int variant=0);
1622  TK_Status Interpret (BStreamFileToolkit & tk, ID_Key key, char const * special)
1623  { return BBaseOpcodeHandler::Interpret(tk, key, special); }
1624 };
1625 
1627 
1634 // Note: unlike most opcode handlers, this one does not contain its own data, it is primarily a
1635 // wrapper around the key <-> index translation table in the toolkit.
1636 class BBINFILETK_API TK_Dictionary : public BBaseOpcodeHandler {
1637  protected:
1638  unsigned char m_format;
1640  unsigned char m_present;
1642 
1643  Internal_Translator::Index_Key_Pair * m_item;
1644 
1645  public:
1647  TK_Dictionary () : BBaseOpcodeHandler (TKE_Dictionary), m_format (0) {}
1648 
1651 
1652  TK_Status ReadAscii (BStreamFileToolkit & tk);
1653  TK_Status WriteAscii (BStreamFileToolkit & tk);
1654 
1656  TK_Status Interpret (BStreamFileToolkit & tk, ID_Key key, int variant=0);
1657  TK_Status Interpret (BStreamFileToolkit & tk, ID_Key key, char const * special)
1658  { return BBaseOpcodeHandler::Interpret(tk, key, special); }
1659  void Reset ();
1660 };
1661 
1662 
1664 
1671 class BBINFILETK_API TK_Dictionary_Locater : public BBaseOpcodeHandler {
1672  protected:
1673  int m_size;
1674  int m_offset;
1675 
1676  public:
1678  TK_Dictionary_Locater () : BBaseOpcodeHandler (TKE_Dictionary_Locater), m_offset (0) {}
1679 
1682 
1683  TK_Status ReadAscii (BStreamFileToolkit & tk);
1684  TK_Status WriteAscii (BStreamFileToolkit & tk);
1685 
1687  TK_Status Interpret (BStreamFileToolkit & tk, ID_Key key, int variant=0);
1688  TK_Status Interpret (BStreamFileToolkit & tk, ID_Key key, char const * special)
1689  { return BBaseOpcodeHandler::Interpret(tk, key, special); }
1690  void Reset ();
1691 
1693  void SetSize (int size) { m_size = size; }
1695  int GetSize () const { return m_size; }
1697  void SetOffset (int offset) { m_offset = offset; }
1699  int GetOffset () const { return m_offset; }
1700 };
1701 
1702 
1704 
1705 
1707 
1712 class BBINFILETK_API TK_Color : public BBaseOpcodeHandler {
1713  protected:
1714  int m_mask;
1715  short m_channels;
1716 
1720  class BBINFILETK_API channel {
1721  public:
1722  float m_rgb[3];
1723  char * m_name;
1724 
1725  channel() : m_name (0) {}
1726  ~channel() { Reset(); }
1727  void Reset () {
1728  if (m_name)
1729  BSTREAM_FREE_ARRAY(m_name, (int)(strlen(m_name) + 1), char);
1730  m_name = 0;
1731  }
1732  };
1733 
1741  float m_gloss;
1742  float m_index;
1744 
1746  void set_channel_rgb (channel & c, float r, float g, float b, int which_channel = -1) {
1747  c.m_rgb[0] = r; c.m_rgb[1] = g; c.m_rgb[2] = b;
1748  if (which_channel != -1) {
1749  m_channels |= (1 << which_channel);
1750  if (which_channel > TKO_Channel_Extended)
1751  m_channels |= (1 << TKO_Channel_Extended);
1752  }
1753  }
1755  void set_channel_name (channel & c, char const * name, int which_channel = -1);
1757  void set_channel_name (channel & c, int length, int which_channel = -1);
1758 
1759  public:
1760  TK_Color ();
1761  ~TK_Color ();
1762 
1763  TK_Status Read (BStreamFileToolkit & tk);
1764  TK_Status Write (BStreamFileToolkit & tk);
1765  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
1766 
1767  TK_Status ReadAscii (BStreamFileToolkit & tk);
1768  TK_Status WriteAscii (BStreamFileToolkit & tk);
1769 
1770  void Reset ();
1771 
1773  void SetGeometry (int m) {
1774  m_mask = m & TKO_Geo_All_Colors;
1775  if ((m & TKO_Geo_Extended_Mask) != 0) {
1776  m_mask |= TKO_Geo_Extended;
1777  if ((m & TKO_Geo_Extended_Colors_Mask) != 0) {
1778  m_mask |= TKO_Geo_Extended_Colors;
1779  if ((m & TKO_Geo_Extended2_Mask) != 0)
1780  m_mask |= TKO_Geo_Extended2;
1781  }
1782  }
1783  }
1785  int GetGeometry () const { return m_mask; }
1787  void SetChannels (int c) {
1788  m_channels = (short)c;
1789  if ((c & (((unsigned int)~0) << (TKO_Channel_Extended_Shift))) != 0)
1790  m_channels |= (1 << TKO_Channel_Extended);
1791  }
1793  int GetChannels () const { return (int)m_channels; }
1794 
1796  void SetDiffuse (float r, float g, float b) { set_channel_rgb (m_diffuse, r, g, b, TKO_Channel_Diffuse); }
1798  void SetDiffuse (float const rgb[]) { SetDiffuse (rgb[0], rgb[1], rgb[2]); }
1800  void SetDiffuseName (char const * name) { set_channel_name (m_diffuse, name, TKO_Channel_Diffuse); }
1802  void SetDiffuseName (int length) { set_channel_name (m_diffuse, length, TKO_Channel_Diffuse); }
1804  float const * GetDiffuse () const { return m_diffuse.m_rgb; }
1806  char const * GetDiffuseName () const { return m_diffuse.m_name; }
1808  char * GetDiffuseName () { return m_diffuse.m_name; }
1809 
1811  void SetSpecular (float r, float g, float b) { set_channel_rgb (m_specular, r, g, b, TKO_Channel_Specular);}
1813  void SetSpecular (float const rgb[]) { SetSpecular (rgb[0], rgb[1], rgb[2]); }
1815  void SetSpecularName (char const * name) { set_channel_name (m_specular, name, TKO_Channel_Specular); }
1817  void SetSpecularName (int length) { set_channel_name (m_specular, length, TKO_Channel_Specular);}
1819  float const * GetSpecular () const { return m_specular.m_rgb; }
1821  char const * GetSpecularName () const { return m_specular.m_name; }
1823  char * GetSpecularName () { return m_specular.m_name; }
1824 
1826  void SetMirror (float r, float g, float b) { set_channel_rgb (m_mirror, r, g, b, TKO_Channel_Mirror); }
1828  void SetMirror (float const rgb[]) { SetMirror (rgb[0], rgb[1], rgb[2]); }
1830  void SetMirrorName (char const * name) { set_channel_name (m_mirror, name, TKO_Channel_Mirror); }
1832  void SetMirrorName (int length) { set_channel_name (m_mirror, length, TKO_Channel_Mirror); }
1834  float const * GetMirror () const { return m_mirror.m_rgb; }
1836  char const * GetMirrorName () const { return m_mirror.m_name; }
1838  char * GetMirrorName () { return m_mirror.m_name; }
1839 
1841  void SetTransmission (float r, float g, float b) { set_channel_rgb (m_transmission, r, g, b, TKO_Channel_Transmission); }
1843  void SetTransmission (float const rgb[]) { SetTransmission (rgb[0], rgb[1], rgb[2]); }
1845  void SetTransmissionName (char const * name) { set_channel_name (m_transmission, name, TKO_Channel_Transmission); }
1847  void SetTransmissionName (int length) { set_channel_name (m_transmission, length, TKO_Channel_Transmission); }
1849  float const * GetTransmission () const { return m_transmission.m_rgb; }
1851  char const * GetTransmissionName () const { return m_transmission.m_name; }
1853  char * GetTransmissionName () { return m_transmission.m_name; }
1854 
1856  void SetEmission (float r, float g, float b) { set_channel_rgb (m_emission, r, g, b, TKO_Channel_Emission);}
1858  void SetEmission (float const rgb[]) { SetEmission (rgb[0], rgb[1], rgb[2]); }
1860  void SetEmissionName (char const * name) { set_channel_name (m_emission, name, TKO_Channel_Emission); }
1862  void SetEmissionName (int length) { set_channel_name (m_emission, length, TKO_Channel_Emission);}
1864  float const * GetEmission () const { return m_emission.m_rgb; }
1866  char const * GetEmissionName () const { return m_emission.m_name; }
1868  char * GetEmissionName () { return m_emission.m_name; }
1869 
1871  void SetEnvironmentName (char const * name) { set_channel_name (m_environment, name, TKO_Channel_Environment); }
1873  void SetEnvironmentName (int length) { set_channel_name (m_environment, length, TKO_Channel_Environment); }
1875  char const * GetEnvironmentName () const { return m_environment.m_name; }
1877  char * GetEnvironmentName () { return m_environment.m_name; }
1878 
1880  void SetBumpName (char const * name) { set_channel_name (m_bump, name, TKO_Channel_Bump); }
1882  void SetBumpName (int length) { set_channel_name (m_bump, length, TKO_Channel_Bump); }
1884  char const * GetBumpName () const { return m_bump.m_name; }
1886  char * GetBumpName () { return m_bump.m_name; }
1887 
1889  void SetGloss (float g) { m_gloss = g; m_channels |= (1<<TKO_Channel_Gloss); }
1891  float GetGloss () const { return m_gloss; }
1893  void SetIndex (float i) { m_index = i; m_channels |= (1<<TKO_Channel_Index); }
1895  float GetIndex () const { return m_index; }
1896 };
1897 
1898 
1900 
1905 class BBINFILETK_API TK_Color_RGB : public BBaseOpcodeHandler {
1906  protected:
1907  int m_mask;
1908  float m_rgb[3];
1909 
1910  public:
1912  TK_Color_RGB () : BBaseOpcodeHandler (TKE_Color_RGB), m_mask (0) {}
1913 
1916  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
1917 
1918  TK_Status ReadAscii (BStreamFileToolkit & tk);
1919  TK_Status WriteAscii (BStreamFileToolkit & tk);
1920 
1925  void SetGeometry (int m) {
1926  m_mask = m & TKO_Geo_All_Colors;
1927  if ((m & TKO_Geo_Extended_Mask) != 0) {
1928  m_mask |= TKO_Geo_Extended;
1929  if ((m & TKO_Geo_Extended_Colors_Mask) != 0) {
1930  m_mask |= TKO_Geo_Extended_Colors;
1931  if ((m & TKO_Geo_Extended2_Mask) != 0)
1932  m_mask |= TKO_Geo_Extended2;
1933  }
1934  }
1935  }
1940  int GetGeometry () const { return m_mask; }
1941 
1943  void SetRGB (float r, float g, float b) { m_rgb[0] = r; m_rgb[1] = g; m_rgb[2] = b; }
1945  void SetRGB (float const rgb[]) { SetRGB (rgb[0], rgb[1], rgb[2]); }
1947  float const * GetRGB () const { return m_rgb; }
1948 };
1949 
1950 
1952 
1957 class BBINFILETK_API TK_Color_By_Value : public BBaseOpcodeHandler {
1958  protected:
1959  int m_mask;
1960  float m_value[3];
1961  char m_space;
1962 
1963  public:
1965  TK_Color_By_Value () : BBaseOpcodeHandler (TKE_Color_By_Value), m_mask (0) {}
1966 
1969  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
1970 
1971  TK_Status ReadAscii (BStreamFileToolkit & tk);
1972  TK_Status WriteAscii (BStreamFileToolkit & tk);
1973 
1978  void SetGeometry (int m) {
1979  m_mask = m & TKO_Geo_All_Colors;
1980  if ((m & TKO_Geo_Extended_Mask) != 0) {
1981  m_mask |= TKO_Geo_Extended;
1982  if ((m & TKO_Geo_Extended_Colors_Mask) != 0) {
1983  m_mask |= TKO_Geo_Extended_Colors;
1984  if ((m & TKO_Geo_Extended2_Mask) != 0)
1985  m_mask |= TKO_Geo_Extended2;
1986  }
1987  }
1988  }
1993  int GetGeometry () const { return m_mask; }
1994 
1996  void SetSpace (int s) { m_space = (char)s; }
1998  int GetSpace () const { return (int)m_space; }
1999 
2001  void SetValue (float a, float b, float c) {
2002  m_value[0] = a; m_value[1] = b; m_value[2] = c;
2003  }
2005  void SetValue (float const triple[]) { SetValue (triple[0], triple[1], triple[2]); }
2007  float const * GetValue () const { return m_value; }
2008 };
2009 
2010 
2012 
2018 class BBINFILETK_API TK_Color_By_Index : public BBaseOpcodeHandler {
2019  protected:
2020  int m_mask;
2021  int m_index;
2022 
2023  public:
2025  TK_Color_By_Index (unsigned char opcode) : BBaseOpcodeHandler (opcode), m_mask (0), m_index (-1) {}
2026 
2029  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
2030 
2031  TK_Status ReadAscii (BStreamFileToolkit & tk);
2032  TK_Status WriteAscii (BStreamFileToolkit & tk);
2033 
2038  void SetGeometry (int m) {
2039  m_mask = m & TKO_Geo_All_Colors;
2040  if ((m & TKO_Geo_Extended_Mask) != 0) {
2041  m_mask |= TKO_Geo_Extended;
2042  if ((m & TKO_Geo_Extended_Colors_Mask) != 0) {
2043  m_mask |= TKO_Geo_Extended_Colors;
2044  if ((m & TKO_Geo_Extended2_Mask) != 0)
2045  m_mask |= TKO_Geo_Extended2;
2046  }
2047  }
2048  }
2053  int GetGeometry () const { return m_mask; }
2054 
2056  void SetIndex (int i) { m_index = i; }
2058  int GetIndex () const { return m_index; }
2059 };
2060 
2062 
2067 class BBINFILETK_API TK_Color_By_FIndex : public BBaseOpcodeHandler {
2068  protected:
2069  int m_mask;
2070  float m_index;
2071 
2072  public:
2074  TK_Color_By_FIndex () : BBaseOpcodeHandler (TKE_Color_By_FIndex), m_mask (0), m_index (-1.0f) {}
2075 
2078  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
2079 
2080  TK_Status ReadAscii (BStreamFileToolkit & tk);
2081  TK_Status WriteAscii (BStreamFileToolkit & tk);
2082 
2087  void SetGeometry (int m) {
2088  m_mask = m & TKO_Geo_All_Colors;
2089  if ((m & TKO_Geo_Extended_Mask) != 0) {
2090  m_mask |= TKO_Geo_Extended;
2091  if ((m & TKO_Geo_Extended_Colors_Mask) != 0) {
2092  m_mask |= TKO_Geo_Extended_Colors;
2093  if ((m & TKO_Geo_Extended2_Mask) != 0)
2094  m_mask |= TKO_Geo_Extended2;
2095  }
2096  }
2097  }
2102  int GetGeometry () const { return m_mask; }
2103 
2105  void SetIndex (float val) { m_index = val; }
2107  float GetIndex () const { return m_index; }
2108 };
2109 
2110 
2113 
2118 class BBINFILETK_API TK_Color_Map : public BBaseOpcodeHandler {
2119  protected:
2120  int m_length;
2122  float * m_values;
2124  char * m_string;
2125  unsigned char m_format;
2126 
2128  void set_values (int length, float const values[] = 0);
2129 
2130  public:
2133  : BBaseOpcodeHandler (TKE_Color_Map), m_length (0), m_values_length (0), m_values (0), m_string_length (0), m_string (0), m_format (TKO_Map_RGB_Values) {}
2134  ~TK_Color_Map();
2135 
2138  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
2139 
2140  TK_Status ReadAscii (BStreamFileToolkit & tk);
2141  TK_Status WriteAscii (BStreamFileToolkit & tk);
2142 
2143  void Reset ();
2144 
2146  void SetFormat (int f) { m_format = (unsigned char)f; }
2148  int GetFormat () const { return (int)m_format; }
2149 
2154  void SetValues (int count, float const values[] = 0) { set_values (count, values); }
2156  float const * GetValues () const { return m_values; }
2158  float * GetValues () { return m_values; }
2160  int GetLength () const { return m_length; }
2161 
2166  void SetString (char const * string);
2171  void SetString (int length);
2175  char const * GetString () const { return m_string; }
2180  char * GetString () { return m_string; }
2181 };
2182 
2184 
2186 
2191 class BBINFILETK_API TK_PBR : public BBaseOpcodeHandler {
2192  protected:
2193  int m_options;
2194  char * m_base_color_map;
2195  char * m_normal_map;
2196  char * m_emissive_map;
2197  char * m_metalness_map;
2198  char * m_roughness_map;
2199  char * m_occlusion_map;
2200  float m_base_color_factor[4];
2201  float m_normal_factor;
2202  float m_metalness_factor;
2203  float m_roughness_factor;
2204  float m_occlusion_factor;
2205  float m_alpha_factor;
2206  char m_metalness_map_channel;
2207  char m_roughness_map_channel;
2208  char m_occlusion_map_channel;
2209 
2210 
2211  void set_string (char * & s, int length);
2212  void set_string (char * & s, char const * name);
2213  void reset_string (char * & s) {
2214  if (s)
2215  BSTREAM_FREE_ARRAY(s, (int)(strlen(s) + 1), char);
2216  s = 0;
2217  }
2218 
2219 
2220  public:
2221  TK_PBR ();
2222  ~TK_PBR ();
2223 
2226  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
2227 
2228  TK_Status ReadAscii (BStreamFileToolkit & tk);
2229  TK_Status WriteAscii (BStreamFileToolkit & tk);
2230 
2231  void Reset ();
2232 
2233 
2237  void SetOptions (int m) { m_options = m; }
2241  int GetOptions () const { return m_options; }
2242 
2243 
2244 
2246  void SetBaseColorMap (char const * name) { set_string (m_base_color_map, name); }
2248  void SetBaseColorMap (int length) { set_string (m_base_color_map, length); }
2250  char const * GetBaseColorMap () const { return m_base_color_map; }
2252  char * GetBaseColorMap () { return m_base_color_map; }
2253 
2255  void SetNormalMap (char const * name) { set_string (m_normal_map, name); }
2257  void SetNormalMap (int length) { set_string (m_normal_map, length); }
2259  char const * GetNormalMap () const { return m_normal_map; }
2261  char * GetNormalMap () { return m_normal_map; }
2262 
2264  void SetEmissiveMap (char const * name) { set_string (m_emissive_map, name); }
2266  void SetEmissiveMap (int length) { set_string (m_emissive_map, length); }
2268  char const * GetEmissiveMap () const { return m_emissive_map; }
2270  char * GetEmissiveMap () { return m_emissive_map; }
2271 
2273  void SetMetalnessMap (char const * name) { set_string (m_metalness_map, name); }
2275  void SetMetalnessMap (int length) { set_string (m_metalness_map, length); }
2277  char const * GetMetalnessMap () const { return m_metalness_map; }
2279  char * GetMetalnessMap () { return m_metalness_map; }
2280 
2282  void SetRoughnessMap (char const * name) { set_string (m_roughness_map, name); }
2284  void SetRoughnessMap (int length) { set_string (m_roughness_map, length); }
2286  char const * GetRoughnessMap () const { return m_roughness_map; }
2288  char * GetRoughnessMap () { return m_roughness_map; }
2289 
2291  void SetOcclusionMap (char const * name) { set_string (m_occlusion_map, name); }
2293  void SetOcclusionMap (int length) { set_string (m_occlusion_map, length); }
2295  char const * GetOcclusionMap () const { return m_occlusion_map; }
2297  char * GetOcclusionMap () { return m_occlusion_map; }
2298 
2299 
2301  void SetBaseColorFactor (float r, float g, float b, float a) {
2302  m_base_color_factor[0] = r;
2303  m_base_color_factor[1] = g;
2304  m_base_color_factor[2] = b;
2305  m_base_color_factor[3] = a;
2306 
2307  }
2309  void SetBaseColorFactor (float const rgba[])
2310  { SetBaseColorFactor (rgba[0], rgba[1], rgba[2], rgba[3]); }
2312  float const * GetBaseColorFactor () const { return m_base_color_factor; }
2313 
2315  void SetNormalFactor (float f) { m_normal_factor = f; }
2317  float GetNormalFactor () const { return m_normal_factor; }
2318 
2320  void SetMetalnessFactor (float f) { m_metalness_factor = f; }
2322  float GetMetalnessFactor () const { return m_metalness_factor; }
2323 
2325  void SetRoughnessFactor (float f) { m_roughness_factor = f; }
2327  float GetRoughnessFactor () const { return m_roughness_factor; }
2328 
2330  void SetOcclusionFactor (float f) { m_occlusion_factor = f; }
2332  float GetOcclusionFactor () const { return m_occlusion_factor; }
2333 
2335  void SetAlphaFactor (float f) { m_alpha_factor = f; }
2337  float GetAlphaFactor () const { return m_alpha_factor; }
2338 
2339 
2341  void SetMetalnessMapChannel (int c) { m_metalness_map_channel = (char)c; }
2343  int GetMetalnessMapChannel () const { return m_metalness_map_channel; }
2344 
2346  void SetRoughnessMapChannel (int c) { m_roughness_map_channel = (char)c; }
2348  int GetRoughnessMapChannel () const { return m_roughness_map_channel; }
2349 
2351  void SetOcclusionMapChannel (int c) { m_occlusion_map_channel = (char)c; }
2353  int GetOcclusionMapChannel () const { return m_occlusion_map_channel; }
2354 };
2355 
2356 
2358 
2361 
2367 class BBINFILETK_API TK_Callback : public BBaseOpcodeHandler {
2368  protected:
2369  int m_length;
2370  char * m_string;
2373  void set_callback (char const * callback);
2374 
2375  void set_callback (int length);
2376 
2377  public:
2379  TK_Callback () : BBaseOpcodeHandler (TKE_Callback), m_length (0), m_string (0) {}
2380  ~TK_Callback();
2381 
2384  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
2385 
2386  TK_Status ReadAscii (BStreamFileToolkit & tk);
2387  TK_Status WriteAscii (BStreamFileToolkit & tk);
2388 
2389  void Reset ();
2390 
2392  void SetCallback (char const * callback) { set_callback (callback); }
2394  void SetCallback (int length) { set_callback (length); }
2396  char const * GetCallback () const { return m_string; }
2398  char * GetCallback () { return m_string; }
2399 };
2400 
2402 
2403 
2404 #if 0
2405 class BBINFILETK_API TK_Radiosity_RayTrace_Options : public BBaseOpcodeHandler {
2406  protected:
2407 
2408  public:
2409  TK_Radiosity_RayTrace_Options () : BBaseOpcodeHandler (TKE_Radiosity_RayTrace_Options) {}
2410  ~TK_Radiosity_RayTrace_Options () {}
2411 
2414 
2415  TK_Status ReadAscii (BStreamFileToolkit & tk);
2416  TK_Status WriteAscii (BStreamFileToolkit & tk);
2417 };
2418 #endif
2419 
2420 
2422 
2428 class BBINFILETK_API TK_Rendering_Options : public BBaseOpcodeHandler {
2429  protected:
2430  int m_mask[3];
2431  int m_value[3];
2432 
2433  unsigned char m_hsr;
2434  unsigned char m_tq;
2435  int m_debug;
2438 
2439  float m_fog_limits[2];
2440 
2443 
2444  unsigned char m_buffer_options_mask;
2445  unsigned char m_buffer_options_value;
2447 
2453  float m_hlr_color[3];
2455  unsigned char m_hlr_weight_units;
2457  unsigned char m_hlr_threshold_units;
2458  unsigned char m_hlr_hsr_algorithm;
2459 
2460  unsigned short m_contour_options;
2461  unsigned short m_isoline_options;
2474  unsigned char * m_isoline_weights_unit;
2475 
2476  unsigned short m_tint_options;
2477  float m_tint_color[3];
2478  float m_tint_range[2];
2480 
2485  float m_ratio[8];
2487  float m_threshold[8];
2490  unsigned char m_clamp;
2491  unsigned char m_num_levels;
2493  float m_tolerance;
2494  float m_bounding[6];
2496  float m_cutoff[8];
2497  unsigned char m_heuristic;
2498  unsigned char m_fallback;
2499 
2513 
2516 
2517  unsigned char m_tessellations;
2519  char m_cylinder[8];
2521  char m_sphere[8];
2522 
2523  float m_gooch_color_range[2];
2527  unsigned short m_transparency_options;
2528 
2529  unsigned char m_cut_geometry;
2530  unsigned char m_cut_geometry_level;
2531  unsigned char m_cut_geometry_match;
2537 
2538  unsigned short m_simple_shadow;
2539  unsigned char m_simple_shadow_blur;
2541  float m_simple_shadow_plane[4];
2542  float m_simple_shadow_light[3];
2543  float m_simple_shadow_color[3];
2544  float m_simple_shadow_opacity;
2545 
2546  unsigned short m_shadow_map;
2547  unsigned short m_shadow_map_resolution;
2548  unsigned char m_shadow_map_samples;
2549 
2550  unsigned short m_simple_reflection;
2551  float m_simple_reflection_plane[4];
2558 
2559  float m_depth_range[2];
2560  float m_screen_range[8];
2561  float m_ambient_up_vector[3];
2562  float m_image_scale[2];
2563  unsigned short m_mask_transform;
2564 
2565  unsigned char m_geometry_options;
2566  float m_dihedral;
2567 
2568  float m_image_tint_color[3];
2569  float m_texture_tint_color[3];
2570  unsigned char m_depth_peeling_layers;
2573 
2578  unsigned char m_display_list_level;
2579  unsigned char m_antialias;
2580 
2581  short m_fbe_mask;
2582  short m_fbe_value;
2583 
2584  float m_eye_dome_lighting_back_color[3];
2585 
2588 
2590 
2591  int m_extra;
2592 
2593 #if 0
2594  TK_Radiosity_RayTrace_Options *m_rrt;
2595 #endif
2596 
2597  public:
2601 
2604  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
2605 
2606  TK_Status ReadAscii (BStreamFileToolkit & tk);
2607  TK_Status WriteAscii (BStreamFileToolkit & tk);
2608 
2609  void Reset ();
2610 
2612  void SetMask (int m0, int m1=0, int m2=0) {
2613  m_mask[0] = m0;
2614  m_mask[1] = m1;
2615  m_mask[2] = m2;
2616  if (m2 != 0)
2617  m_mask[1] |= TKO_Rendo_Extended;
2618  if (m1 != 0)
2619  m_mask[0] |= TKO_Rendo_Extended;
2620  }
2622  int GetMask (int index=0) const { return m_mask[index]; }
2623 
2625  void SetValue (int v0, int v1=0, int v2=0) { m_value[0] = v0; m_value[1] = v1; m_value[2] = v2; }
2627  int GetValue (int index=0) const { return m_value[index]; }
2628 
2630  void SetHSR (int h) { m_hsr &= 0xF0; m_hsr |= (unsigned char)h & 0x0F; }
2632  int GetHSR () const { return (int)(m_hsr & 0x0F); }
2633 
2635  void SetTransparentHSR (int t) { m_hsr &= 0x0F; m_hsr |= (unsigned char)t << 4; }
2637  int GetTransparentHSR () const { return (int)(m_hsr >> 4); }
2638 
2640  void SetTransparentStyle (int s) { m_transparency_options = (unsigned short)s; }
2642  int GetTransparentStyle () const { return (int)m_transparency_options; }
2643 
2645  void SetTechnology (int t) { m_tq &= 0xF0; m_tq |= (unsigned char)t & 0x0F; }
2647  int GetTechnology () const { return (int)(m_tq & 0x0F); }
2648 
2650  void SetQuantization (int q) { m_tq &= 0x0F; m_tq |= (unsigned char)q << 4; }
2652  int GetQuantization () const { return (int)(m_tq >> 4); }
2653 
2655  void SetDebug (int d) { m_debug = d; }
2657  int GetDebug () const { return m_debug; }
2658 
2660  void SetFaceDisplacement (int d) { m_face_displacement = d; }
2662  int GetFaceDisplacement () const { return m_face_displacement; }
2663 
2665  void SetVertexDisplacement (int d) { m_vertex_displacement = d; }
2667  int GetVertexDisplacement () const { return m_vertex_displacement; }
2668 
2670  void SetGeneralDisplacement (int d) { m_general_displacement = d; }
2672  int GetGeneralDisplacement () const { return m_general_displacement; }
2673 
2675  void SetJoinCutoffAngle (int d) { m_join_cutoff_angle = d; }
2677  int GetJoinCutoffAngle () const { return m_join_cutoff_angle; }
2678 
2680  void SetFogLimits (float n, float f) { m_fog_limits[0] = n; m_fog_limits[1] = f; }
2682  void SetFogLimits (float const l[]) { SetFogLimits (l[0], l[1]); }
2684  float const * GetFogLimits () const { return m_fog_limits; }
2685 
2686 
2688  void SetLockMask (int m) { m_lock.mask = m; }
2690  int GetLockMask () const { return m_lock.mask; }
2691 
2693  void SetLockValue (int v) { m_lock.value = v; }
2695  int GetLockValue () const { return m_lock.value; }
2696 
2701  void SetVisibilityLockMask (int m) { m_lock.visibility_mask = m; }
2706  int GetVisibilityLockMask () const { return m_lock.visibility_mask; }
2707 
2712  void SetVisibilityLockValue (int v) { m_lock.visibility_value = v; }
2717  int GetVisibilityLockValue () const { return m_lock.visibility_value; }
2718 
2719 
2724  void SetColorLockMask (int m) { m_lock.color_mask = m; }
2729  int GetColorLockMask () const { return m_lock.color_mask; }
2730 
2735  void SetColorLockValue (int v) { m_lock.color_value = v; }
2740  int GetColorLockValue () const { return m_lock.color_value; }
2741 
2742 
2747  void SetColorFaceLockMask (int m) { m_lock.color_face_mask = (short)m; }
2752  int GetColorFaceLockMask () const { return m_lock.color_face_mask; }
2753 
2758  void SetColorFaceLockValue (int v) { m_lock.color_face_value = (short)v; }
2763  int GetColorFaceLockValue () const { return m_lock.color_face_value; }
2764 
2765 
2770  void SetColorEdgeLockMask (int m) { m_lock.color_edge_mask = (short)m; }
2775  int GetColorEdgeLockMask () const { return m_lock.color_edge_mask; }
2776 
2781  void SetColorEdgeLockValue (int v) { m_lock.color_edge_value = (short)v; }
2786  int GetColorEdgeLockValue () const { return m_lock.color_edge_value; }
2787 
2788 
2793  void SetColorLineLockMask (int m) { m_lock.color_line_mask = (short)m; }
2798  int GetColorLineLockMask () const { return m_lock.color_line_mask; }
2799 
2804  void SetColorLineLockValue (int v) { m_lock.color_line_value = (short)v; }
2809  int GetColorLineLockValue () const { return m_lock.color_line_value; }
2810 
2811 
2816  void SetColorMarkerLockMask (int m) { m_lock.color_marker_mask = (short)m; }
2821  int GetColorMarkerLockMask () const { return m_lock.color_marker_mask; }
2822 
2827  void SetColorMarkerLockValue (int v) { m_lock.color_marker_value = (short)v; }
2832  int GetColorMarkerLockValue () const { return m_lock.color_marker_value; }
2833 
2834 
2839  void SetColorTextLockMask (int m) { m_lock.color_text_mask = (short)m; }
2844  int GetColorTextLockMask () const { return m_lock.color_text_mask; }
2845 
2850  void SetColorTextLockValue (int v) { m_lock.color_text_value = (short)v; }
2855  int GetColorTextLockValue () const { return m_lock.color_text_value; }
2856 
2857 
2862  void SetColorWindowLockMask (int m) { m_lock.color_window_mask = (short)m; }
2867  int GetColorWindowLockMask () const { return m_lock.color_window_mask; }
2868 
2873  void SetColorWindowLockValue (int v) { m_lock.color_window_value = (short)v; }
2878  int GetColorWindowLockValue () const { return m_lock.color_window_value; }
2879 
2880 
2885  void SetColorFaceContrastLockMask (int m) { m_lock.color_face_contrast_mask = (short)m; }
2891 
2896  void SetColorFaceContrastLockValue (int v) { m_lock.color_face_contrast_value = (short)v; }
2902 
2903 
2914 
2925 
2926 
2931  void SetColorBackLockMask (int m) { m_lock.color_back_mask = (short)m; }
2936  int GetColorBackLockMask () const { return m_lock.color_back_mask; }
2937 
2942  void SetColorBackLockValue (int v) { m_lock.color_back_value = (short)v; }
2947  int GetColorBackLockValue () const { return m_lock.color_back_value; }
2948 
2949 
2954  void SetColorVertexLockMask (int m) { m_lock.color_vertex_mask = (short)m; }
2959  int GetColorVertexLockMask () const { return m_lock.color_vertex_mask; }
2960 
2965  void SetColorVertexLockValue (int v) { m_lock.color_vertex_value = (short)v; }
2970  int GetColorVertexLockValue () const { return m_lock.color_vertex_value; }
2971 
2972 
2977  void SetColorEdgeContrastLockMask (int m) { m_lock.color_edge_contrast_mask = (short)m; }
2983 
2988  void SetColorEdgeContrastLockValue (int v) { m_lock.color_edge_contrast_value = (short)v; }
2994 
2995 
3000  void SetColorLineContrastLockMask (int m) { m_lock.color_line_contrast_mask = (short)m; }
3006 
3011  void SetColorLineContrastLockValue (int v) { m_lock.color_line_contrast_value = (short)v; }
3017 
3018 
3029 
3040 
3041 
3052 
3063 
3064 
3069  void SetColorTextContrastLockMask (int m) { m_lock.color_text_contrast_mask = (short)m; }
3075 
3080  void SetColorTextContrastLockValue (int v) { m_lock.color_text_contrast_value = (short)v; }
3086 
3087 
3088 
3089 
3091  void SetForcedLockMask (int m) { m_forced.mask = m; }
3093  int GetForcedLockMask () const { return m_forced.mask; }
3094 
3096  void SetForcedLockValue (int v) { m_forced.value = v; }
3098  int GetForcedLockValue () const { return m_forced.value; }
3099 
3104  void SetVisibilityForcedLockMask (int m) { m_forced.visibility_mask = m; }
3109  int GetVisibilityForcedLockMask () const { return m_forced.visibility_mask; }
3110 
3115  void SetVisibilityForcedLockValue (int v) { m_forced.visibility_value = v; }
3120  int GetVisibilityForcedLockValue () const { return m_forced.visibility_value; }
3121 
3122 
3127  void SetColorForcedLockMask (int m) { m_forced.color_mask = m; }
3132  int GetColorForcedLockMask () const { return m_forced.color_mask; }
3133 
3138  void SetColorForcedLockValue (int v) { m_forced.color_value = v; }
3143  int GetColorForcedLockValue () const { return m_forced.color_value; }
3144 
3145 
3150  void SetColorFaceForcedLockMask (int m) { m_forced.color_face_mask = (short)m; }
3155  int GetColorFaceForcedLockMask () const { return m_forced.color_face_mask; }
3156 
3161  void SetColorFaceForcedLockValue (int v) { m_forced.color_face_value = (short)v; }
3166  int GetColorFaceForcedLockValue () const { return m_forced.color_face_value; }
3167 
3168 
3173  void SetColorEdgeForcedLockMask (int m) { m_forced.color_edge_mask = (short)m; }
3178  int GetColorEdgeForcedLockMask () const { return m_forced.color_edge_mask; }
3179 
3184  void SetColorEdgeForcedLockValue (int v) { m_forced.color_edge_value = (short)v; }
3189  int GetColorEdgeForcedLockValue () const { return m_forced.color_edge_value; }
3190 
3191 
3196  void SetColorLineForcedLockMask (int m) { m_forced.color_line_mask = (short)m; }
3201  int GetColorLineForcedLockMask () const { return m_forced.color_line_mask; }
3202 
3207  void SetColorLineForcedLockValue (int v) { m_forced.color_line_value = (short)v; }
3212  int GetColorLineForcedLockValue () const { return m_forced.color_line_value; }
3213 
3214 
3219  void SetColorMarkerForcedLockMask (int m) { m_forced.color_marker_mask = (short)m; }
3224  int GetColorMarkerForcedLockMask () const { return m_forced.color_marker_mask; }
3225 
3230  void SetColorMarkerForcedLockValue (int v) { m_forced.color_marker_value = (short)v; }
3235  int GetColorMarkerForcedLockValue () const { return m_forced.color_marker_value; }
3236 
3237 
3242  void SetColorTextForcedLockMask (int m) { m_forced.color_text_mask = (short)m; }
3247  int GetColorTextForcedLockMask () const { return m_forced.color_text_mask; }
3248 
3253  void SetColorTextForcedLockValue (int v) { m_forced.color_text_value = (short)v; }
3258  int GetColorTextForcedLockValue () const { return m_forced.color_text_value; }
3259 
3260 
3265  void SetColorWindowForcedLockMask (int m) { m_forced.color_window_mask = (short)m; }
3270  int GetColorWindowForcedLockMask () const { return m_forced.color_window_mask; }
3271 
3276  void SetColorWindowForcedLockValue (int v) { m_forced.color_window_value = (short)v; }
3281  int GetColorWindowForcedLockValue () const { return m_forced.color_window_value; }
3282 
3283 
3288  void SetColorFaceContrastForcedLockMask (int m) { m_forced.color_face_contrast_mask = (short)m; }
3294 
3305 
3306 
3317 
3328 
3329 
3334  void SetColorBackForcedLockMask (int m) { m_forced.color_back_mask = (short)m; }
3339  int GetColorBackForcedLockMask () const { return m_forced.color_back_mask; }
3340 
3345  void SetColorBackForcedLockValue (int v) { m_forced.color_back_value = (short)v; }
3350  int GetColorBackForcedLockValue () const { return m_forced.color_back_value; }
3351 
3352 
3357  void SetColorVertexForcedLockMask (int m) { m_forced.color_vertex_mask = (short)m; }
3362  int GetColorVertexForcedLockMask () const { return m_forced.color_vertex_mask; }
3363 
3368  void SetColorVertexForcedLockValue (int v) { m_forced.color_vertex_value = (short)v; }
3373  int GetColorVertexForcedLockValue () const { return m_forced.color_vertex_value; }
3374 
3375 
3380  void SetColorEdgeContrastForcedLockMask (int m) { m_forced.color_edge_contrast_mask = (short)m; }
3386 
3397 
3398 
3403  void SetColorLineContrastForcedLockMask (int m) { m_forced.color_line_contrast_mask = (short)m; }
3409 
3420 
3421 
3432 
3443 
3444 
3455 
3466 
3467 
3472  void SetColorTextContrastForcedLockMask (int m) { m_forced.color_text_contrast_mask = (short)m; }
3478 
3489 
3490 
3491 
3492 
3494  void SetBufferOptionsMask (int v) { m_buffer_options_mask = (unsigned char)v; }
3496  int GetBufferOptionsMask () const { return m_buffer_options_mask; }
3498  void SetBufferOptionsValue (int v) { m_buffer_options_value = (unsigned char) v; }
3500  int GetBufferOptionsValue () const { return m_buffer_options_value; }
3502  void SetBufferSizeLimit (int l) { m_buffer_size_limit = l; }
3504  int GetBufferSizeLimit () const { return m_buffer_size_limit; }
3505 
3506 
3508  void SetStereoSeparation (float s) { m_stereo_separation = s; }
3510  float GetStereoSeparation () const { return m_stereo_separation; }
3512  void SetStereoDistance (float d) { m_stereo_distance = d; }
3514  float GetStereoDistance () const { return m_stereo_distance; }
3515 
3516 
3518  void SetHlrOptions (int o) {
3519  m_hlr_options = o;
3520  if ((o & TKO_Hidden_Line_Extended_Mask) != 0) {
3521  m_hlr_options |= TKO_Hidden_Line_Extended;
3522  if ((o & TKO_Hidden_Line_Extended2_Mask) != 0)
3523  m_hlr_options |= TKO_Hidden_Line_Extended2;
3524  }
3525  }
3527  int GetHlrOptions () const { return m_hlr_options; }
3529  void SetHlrDimFactor (float d) { m_hlr_dim_factor = d; }
3531  float GetHlrDimFactor () const { return m_hlr_dim_factor; }
3533  void SetHlrFaceDisplacement (float d) { m_hlr_face_displacement = d; }
3535  float GetHlrFaceDisplacement () const { return m_hlr_face_displacement; }
3537  void SetHlrLinePattern (int p) { m_hlr_line_pattern = p; }
3539  int GetHlrLinePattern () const { return m_hlr_line_pattern; }
3541  void SetHlrFaceSortingAlgorithm (int a) { m_hlr_hsr_algorithm = (unsigned char)a; }
3543  float GetHlrFaceSortingAlgorithm () const { return m_hlr_hsr_algorithm; }
3544 
3545 
3547  void SetNURBSOptionsMask (int m) {
3548  m_nurbs_options_mask = m;
3549  if ((m & TKO_NURBS_Extended_Mask) != 0)
3550  m_nurbs_options_mask |= TKO_NURBS_Extended;
3551  }
3553  int GetNURBSOptionsMask () const { return m_nurbs_options_mask; }
3555  void SetNURBSOptionsValue (int v) { m_nurbs_options_value = v; }
3557  int GetNURBSOptionsValue () const { return m_nurbs_options_value; }
3559  void SetNURBSCurveBudget (int b) { m_curve_budget = b; }
3561  int GetNURBSCurveBudget () const { return m_curve_budget; }
3563  void SetNURBSCurveContinuedBudget (int b) { m_curve_continued_budget = b; }
3565  int GetNURBSCurveContinuedBudget () const { return m_curve_continued_budget; }
3567  void SetNURBSSurfaceBudget (int b) { m_surface_budget = b; }
3569  int GetNURBSSurfaceBudget () const { return m_surface_budget; }
3571  void SetNURBSSurfaceTrimBudget (int b) { m_surface_trim_budget = b; }
3573  int GetNURBSSurfaceTrimBudget () const { return m_surface_trim_budget; }
3574 
3575 
3577  void SetLodOptionsMask (int v) { m_lod_options_mask = v; }
3579  int GetLodOptionsMask () const { return m_lod_options_mask; }
3581  void SetLodOptionsValue (int v) { m_lod_options_value = v; }
3583  int GetLodOptionsValue () const { return m_lod_options_value; }
3585  void SetLodAlgorithm (int v) { m_lod_algorithm = (char)v; }
3587  int GetLodAlgorithm () const { return m_lod_algorithm; }
3589  void SetLodMinimumTriangleCount (int v) { m_min_triangle_count = v; }
3591  int GetLodMinimumTriangleCount () const { return m_min_triangle_count; }
3593  void SetLodNumLevels (int v) { m_num_levels = (unsigned char)v; }
3595  int GetLodNumLevels () const { return m_num_levels; }
3597  void SetLodClamp (int v) { m_clamp = (unsigned char)v; }
3599  int GetLodClamp () const { return m_clamp; }
3601  void SetLodMaxDegree (int v) { m_max_degree = v; }
3603  int GetLodMaxDegree () const { return m_max_degree; }
3605  void SetLodTolerance (float v) { m_tolerance = v; }
3607  float GetLodTolerance () const { return m_tolerance; }
3609  void SetLodFallback (int v) { m_fallback = (char)v; }
3611  int GetLodFallback () const { return m_fallback; }
3612 
3614  void SetLodBounding (float x1, float y1, float z1, float x2, float y2, float z2) {
3615  m_bounding[0] = x1; m_bounding[1] = y1; m_bounding[2] = z1;
3616  m_bounding[3] = x2; m_bounding[4] = y2; m_bounding[5] = z2;
3617  }
3619  void SetLodBounding (float const s[], float const e[]) {
3620  SetLodBounding (s[0], s[1], s[2], e[0], e[1], e[2]);
3621  }
3623  void SetLodBounding (float const p[]) { SetLodBounding (&p[0], &p[3]); }
3625  float const * GetLodBounding () const { return m_bounding; }
3626 
3628  void SetLodRatio (float r) { m_num_ratios = 1; m_ratio[0] = r; }
3630  void SetLodRatios (int c, float const r[] = 0) {
3631  m_num_ratios = (char)c;
3632  if (r != 0) {
3633  int i;
3634  for (i=0; i<c; ++i)
3635  m_ratio[i] = r[i];
3636  }
3637  }
3639  int GetLodNumRatios () const { return m_num_ratios; }
3641  float const * GetLodRatios () const { return m_ratio; }
3643  float * GetLodRatios () { return m_ratio; }
3644 
3646  void SetLodThresholdType (int v) { m_threshold_type = (char)v; }
3648  int GetLodThresholdType () const { return m_threshold_type; }
3650  void SetLodThreshold (float r) { m_num_thresholds = 1; m_threshold[0] = r; }
3652  void SetLodThresholds (int c, float const r[] = 0) {
3653  m_num_thresholds = (char)c;
3654  if (r != 0) {
3655  int i;
3656  for (i=0; i<c; ++i)
3657  m_threshold[i] = r[i];
3658  }
3659  }
3661  int GetLodNumThresholds () const { return m_num_thresholds; }
3663  float const * GetLodThresholds () const { return m_threshold; }
3665  float * GetLodThresholds () { return m_threshold; }
3666 
3668  void SetLodCutoff (float r) { m_num_cutoffs = 1; m_cutoff[0] = r; }
3670  void SetLodCutoffs (int c, float const r[] = 0) {
3671  m_num_cutoffs = (char)c;
3672  if (r != 0) {
3673  int i;
3674  for (i=0; i<c; ++i)
3675  m_cutoff[i] = r[i];
3676  }
3677  }
3679  int GetLodNumCutoffs () const { return m_num_cutoffs; }
3681  float const * GetLodCutoffs () const { return m_cutoff; }
3683  float * GetLodCutoffs () { return m_cutoff; }
3684 
3685 
3687  void SetTessellationMask (int m) { m_tessellations = (unsigned char)m; }
3689  int GetTessellationMask () const { return m_tessellations; }
3691  void SetCylinderTessellation (int n) { m_num_cylinder = (char)1; m_cylinder[0] = (char)n; }
3693  void SetCylinderTessellations (int c, char const * n = 0) {
3694  m_num_cylinder = (char)c;
3695  if (n != 0) {
3696  int i;
3697  for (i=0; i<c; ++i)
3698  m_cylinder[i] = n[i];
3699  }
3700  }
3702  int GetNumCylinderTessellations () const { return m_num_cylinder; }
3704  char const * GetCylinderTessellations () const { return m_cylinder; }
3706  char * GetCylinderTessellations () { return m_cylinder; }
3708  void SetSphereTessellation (int n) { m_num_sphere = (char)1; m_sphere[0] = (char)n; }
3710  void SetSphereTessellations (int c, char const * n = 0) {
3711  m_num_sphere = (char)c;
3712  if (n != 0) {
3713  int i;
3714  for (i=0; i<c; ++i)
3715  m_sphere[i] = n[i];
3716  }
3717  }
3719  int GetNumSphereTessellations () const { return m_num_sphere; }
3721  char const * GetSphereTessellations () const { return m_sphere; }
3723  char * GetSphereTessellations () { return m_sphere; }
3724 
3726  void SetGeometryOptionsMask (int m) { m_geometry_options = (unsigned char)m; }
3728  int GetGeometryOptionsMask () const { return m_geometry_options; }
3729 
3731  void SetHardEdgeAngle (int m) { m_dihedral = (unsigned char)m; }
3733  float GetHardEdgeAngle () const { return m_dihedral; }
3734 
3736  void SetMaskTransform (int m) { m_mask_transform = (unsigned short)m; }
3738  int GetMaskTransform () const { return (int)m_mask_transform; }
3739 
3740 
3742  void SetCutGeometry (int m) { m_cut_geometry = (unsigned char)m; }
3744  int GetCutGeometry () const { return (int)m_cut_geometry; }
3745 
3747  void SetCutGeometryLevel (int m) { m_cut_geometry_level = (unsigned char)m; }
3749  int GetCutGeometryLevel () const { return (int)m_cut_geometry_level; }
3750 
3752  void SetCutGeometryColorMatch (int m) { m_cut_geometry_match = (unsigned char)m; }
3754  int GetCutGeometryColorMatch () const { return (int)m_cut_geometry_match; }
3755 
3757  void SetCutGeometryTolerance (float m) { m_cut_geometry_tolerance = m; }
3759  float GetCutGeometryTolerance () const { return m_cut_geometry_tolerance; }
3760 
3762  void SetCutGeometryEdgeWeight (float value, int units = TKO_Generic_Size_Unspecified) {
3763  m_cut_geometry_edge_weight = (value > 0.0f) ? value : -1.0f;
3764  m_cut_geometry_edge_weight_units = (value > 0.0f) ? (unsigned char) units : (unsigned char) TKO_Generic_Size_Unspecified;
3765  }
3767  float GetCutGeometryEdgeWeight () const { return m_cut_geometry_edge_weight; }
3769  int GetCutGeometryEdgeWeightUnits () const { return m_cut_geometry_edge_weight_units; }
3770 
3772  void SetCutGeometryEdgePattern (char const * pattern);
3774  void SetCutGeometryEdgePattern (int length);
3776  char const * GetCutGeometryEdgePattern () const { return m_cut_geometry_edge_pattern; }
3778  char * GetCutGeometryEdgePattern () { return m_cut_geometry_edge_pattern; }
3779 
3780 
3782  void SetDisplayListLevel (int m) { m_display_list_level = (unsigned char)m; }
3784  int GetDisplayListLevel () const { return (int)m_display_list_level; }
3785 
3787  void SetSimpleShadow (int m) {
3788  m_simple_shadow = (unsigned short)m;
3789  if ((m & TKO_Simple_Shadow_Extended_Mask) != 0)
3790  m_simple_shadow |= TKO_Simple_Shadow_Extended;
3791  }
3793  int GetSimpleShadow () const { return (int)m_simple_shadow; }
3794 
3796  void SetSimpleShadowBlur (int m) { m_simple_shadow_blur = (unsigned char)m; }
3798  int GetSimpleShadowBlur () const { return (int)m_simple_shadow_blur; }
3799 
3801  void SetSimpleShadowResolution (int m) { m_simple_shadow_resolution = (unsigned short)m; }
3803  int GetSimpleShadowResolution () const { return (int)m_simple_shadow_resolution; }
3804 
3806  void SetSimpleShadowLight (float x, float y, float z) {
3807  m_simple_shadow_light[0] = x;
3808  m_simple_shadow_light[1] = y;
3809  m_simple_shadow_light[2] = z;
3810  }
3812  void SetSimpleShadowLight (float const l[]) { SetSimpleShadowLight (l[0], l[1], l[2]); }
3814  float const * getSimpleShadowLight () const { return m_simple_shadow_light; }
3815 
3817  void SetSimpleShadowPlane (float a, float b, float c, float d) {
3818  m_simple_shadow_plane[0] = a;
3819  m_simple_shadow_plane[1] = b;
3820  m_simple_shadow_plane[2] = c;
3821  m_simple_shadow_plane[3] = d;
3822  }
3824  void SetSimpleShadowPlane (float const p[]) { SetSimpleShadowPlane (p[0], p[1], p[2], p[3]); }
3826  float const * GetSimpleShadowPlane () const { return m_simple_shadow_plane; }
3827 
3829  void SetSimpleShadowColor (float r, float g, float b)
3830  { m_simple_shadow_color[0] = r; m_simple_shadow_color[1] = g; m_simple_shadow_color[2] = b; }
3832  void SetSimpleShadowColor (float const rgb[]) { SetSimpleShadowColor (rgb[0], rgb[1], rgb[2]); }
3834  float const * GetSimpleShadowColor () const { return m_simple_shadow_color; }
3835 
3837  void SetSimpleShadowOpacity (float o) { m_simple_shadow_opacity = o; }
3839  float GetSimpleShadowOpacity () const { return m_simple_shadow_opacity; }
3840 
3841 
3843  void SetShadowMap (int m) { m_shadow_map = (unsigned char)m; }
3845  int GetShadowMap () const { return (int)m_shadow_map; }
3846 
3848  void SetShadowMapResolution (int m) { m_shadow_map_resolution = (unsigned short)m; }
3850  int GetShadowMapResolution () const { return (int)m_shadow_map_resolution; }
3851 
3853  void SetShadowMapSamples (int m) { m_shadow_map_samples = (unsigned char)m; }
3855  int GetShadowMapSamples () const { return (int)m_shadow_map_samples; }
3856 
3857 
3859  void SetSimpleReflection (int m) { m_simple_reflection = (unsigned short)m; }
3861  int GetSimpleReflection () const { return (int)m_simple_reflection; }
3862 
3864  void SetSimpleReflectionPlane (float a, float b, float c, float d) {
3865  m_simple_reflection_plane[0] = a;
3866  m_simple_reflection_plane[1] = b;
3867  m_simple_reflection_plane[2] = c;
3868  m_simple_reflection_plane[3] = d;
3869  }
3871  void SetSimpleReflectionPlane (float const p[]) { SetSimpleReflectionPlane (p[0], p[1], p[2], p[3]); }
3873  float const * GetSimpleReflectionPlane () const { return m_simple_reflection_plane; }
3874 
3876  void SetSimpleReflectionOpacity (float o) { m_simple_reflection_opacity = o; }
3878  float GetSimpleReflectionOpacity () const { return m_simple_reflection_opacity; }
3879 
3881  void SetSimpleReflectionVisibilityMask (int m) { m_simple_reflection_visibility_mask = m; }
3883  int GetSimpleReflectionVisibilityValue () const { return m_simple_reflection_visibility_value; }
3884 
3885 
3887  void SetDepthRange (float n, float f) { m_depth_range[0] = n; m_depth_range[1] = f; }
3889  void SetDepthRange (float const l[]) { SetDepthRange (l[0], l[1]); }
3891  float const * GetDepthRange () const { return m_depth_range; }
3892 
3893 
3895  void SetScreenRange (float l, float r, float b, float t,
3896  float lo = 0, float ro = 0, float bo = 0, float to = 0)
3897  { m_screen_range[0] = l; m_screen_range[1] = r; m_screen_range[2] = b; m_screen_range[3] = t;
3898  m_screen_range[4] = lo; m_screen_range[5] = ro; m_screen_range[6] = bo; m_screen_range[7] = to; }
3900  void SetScreenRange (float const l[]) { SetScreenRange (l[0], l[1], l[2], l[3]); }
3902  void SetScreenRange (float const l[], float const o[])
3903  { SetScreenRange (l[0], l[1], l[2], l[3], o[0], o[1], o[2], o[3]); }
3905  void SetScreenRange (int n, float const l[])
3906  { if (n == 8) SetScreenRange (l[0], l[1], l[2], l[4], l[5], l[6], l[7], l[8]);
3907  else SetScreenRange (l[0], l[1], l[2], l[3]);
3908  }
3910  float const * GetScreenRange () const { return m_screen_range; }
3911 
3915  void SetAmbientUpVector (float x, float y, float z)
3916  { m_ambient_up_vector[0] = x; m_ambient_up_vector[1] = y; m_ambient_up_vector[2] = z; }
3918  void SetAmbientUpVector (float const v[]) { SetAmbientUpVector (v[0], v[1], v[2]); }
3920  float const * GetAmbientUpVector () const { return m_ambient_up_vector; }
3921 
3923  void SetImageScale (float x, float y) { m_image_scale[0] = x; m_image_scale[1] = y; }
3925  void SetImageScale (float const s[]) { SetImageScale (s[0], s[1]); }
3927  float const * GetImageScale () const { return m_image_scale; }
3928 
3929 
3931  void SetImageTintColor (float r, float g, float b)
3932  { m_image_tint_color[0] = r; m_image_tint_color[1] = g; m_image_tint_color[2] = b; }
3934  void SetImageTintColor (float const rgb[]) { SetImageTintColor (rgb[0], rgb[1], rgb[2]); }
3936  float const * GetImageTintColor () const { return m_image_tint_color; }
3937 
3939  void SetDiffuseTextureTintColor (float r, float g, float b)
3940  { m_texture_tint_color[0] = r; m_texture_tint_color[1] = g; m_texture_tint_color[2] = b; }
3942  void SetDiffuseTextureTintColor (float const rgb[]) { SetDiffuseTextureTintColor (rgb[0], rgb[1], rgb[2]); }
3944  float const * GetDiffuseTextureTintColor () const { return m_texture_tint_color; }
3945 
3947  void SetAntiAlias (int m) { m_antialias = (unsigned char)m; }
3949  int GetAntiAlias () const { return (int)m_antialias; }
3950 
3952  void SetVertexDecimation (float f) { m_vertex_decimation = f; }
3954  float GetVertexDecimation () const { return m_vertex_decimation; }
3955 };
3956 
3958 
3959 
3961 
3967 class BBINFILETK_API TK_Heuristics : public BBaseOpcodeHandler {
3968  protected:
3969  int m_mask;
3970  int m_value;
3971 
3975 
3976  unsigned char m_extras;
3979  unsigned short m_selection_bias;
3986  float m_vector[3];
3989  float m_view_volume[6];
3990 
3991  unsigned char m_ordered_weights_mask;
3992  float m_ordered_weights[TKO_Heur_Order_Count];
3993  unsigned char m_selection_level;
3994  unsigned char m_selection_sorting;
3995  unsigned char m_model_type;
3996 
3997  public:
3999  TK_Heuristics () : BBaseOpcodeHandler (TKE_Heuristics),
4000  m_mask (0), m_value (0), m_culling(0), m_selection_culling(0), m_selection_bias(0),
4001  m_pixel_threshold (0), m_maximum_extent (0), m_maximum_extent_mode(0) {}
4002  ~TK_Heuristics ();
4003 
4006  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
4007 
4008  TK_Status ReadAscii (BStreamFileToolkit & tk);
4009  TK_Status WriteAscii (BStreamFileToolkit & tk);
4010 
4012  void SetMask (int m) {
4013  m_mask = m;
4014  if ((m & TKO_Heuristic_Extended_Mask) != 0)
4015  m_mask |= TKO_Heuristic_Extended;
4016  }
4018  int GetMask () const { return m_mask; }
4019 
4021  void SetValue (int v) { m_value = v; }
4023  int GetValue () const { return m_value; }
4024 
4026  void SetRelatedSelectionLimit (int r) { m_related = r; }
4028  int GetRelatedSelectionLimit () const { return m_related; }
4029 
4031  void SetInternalSelectionLimit (int i) { m_internal_shell = m_internal_polyline = i; }
4033  int GetInternalSelectionLimit () const { return m_internal_shell; }
4034 
4036  void SetInternalShellSelectionLimit (int i) { m_internal_shell = i; }
4038  int GetInternalShellSelectionLimit () const { return m_internal_shell; }
4039 
4041  void SetInternalPolylineSelectionLimit (int i) { m_internal_polyline = i; }
4043  int GetInternalPolylineSelectionLimit () const { return m_internal_polyline; }
4044 
4046  void SetExtras (int e) { m_extras = (unsigned char)e; }
4048  int GetExtras () const { return (int)m_extras; }
4049 
4051  void SetCulling (int c) { m_culling = c; }
4053  int GetCulling () const { return (int)m_culling; }
4055  void SetSelectionCulling (int c) { m_selection_culling = (unsigned short)c; }
4057  int GetSelectionCulling () const { return (int)m_selection_culling; }
4059  void SetSelectionBias (int c) { m_selection_bias = (unsigned short)c; }
4061  int GetSelectionBias () const { return (int)m_selection_bias; }
4063  void SetPixelThreshold (int c) { m_pixel_threshold = c; }
4065  int GetPixelThreshold () const { return m_pixel_threshold; }
4067  void SetMaximumExtent (int c) { m_maximum_extent = c; }
4069  int GetMaximumExtent () const { return m_maximum_extent; }
4071  int GetMaximumExtentMode () const { return m_maximum_extent_mode; }
4073  void SetMaximumExtentMode (int c) { m_maximum_extent_mode = c; }
4075  int GetMaximumExtentLevel () const { return m_maximum_extent_level; }
4077  void SetMaximumExtentLevel (int c) { m_maximum_extent_level = (unsigned char)c; }
4079  void SetHardExtent (int c) { m_hard_extent = c; }
4081  int GetHardExtent () const { return m_hard_extent; }
4083  float const * GetVector () const { return m_vector; }
4085  void SetVector (float x, float y, float z) {
4086  m_vector[0] = x;
4087  m_vector[1] = y;
4088  m_vector[2] = z;
4089  }
4091  void SetVector (float const v[]) { SetVector(v[0], v[1], v[2]); }
4093  float GetVectorTolerance () const { return m_vector_tolerance; }
4095  void SetVectorTolerance (float tol) { m_vector_tolerance = tol; }
4096 
4097  void SetMaxDistance (float m) { m_max_distance = m; }
4099  float GetMaxDistance () const { return m_max_distance; }
4100 
4102  float const * GetViewVolume () const { return m_view_volume; }
4104  void SetViewVolume (float ax, float ay, float az, float bx, float by, float bz) {
4105  m_view_volume[0] = ax;
4106  m_view_volume[1] = ay;
4107  m_view_volume[2] = az;
4108  m_view_volume[3] = bx;
4109  m_view_volume[4] = by;
4110  m_view_volume[5] = bz;
4111  }
4113  void SetViewVolume (float const v[]) { SetViewVolume(v[0], v[1], v[2], v[3], v[4], v[5]); }
4114 
4116  void SetOrderedWeightsMask (int c) { m_ordered_weights_mask = (unsigned char)c; }
4118  int GetOrderedWeightsMask () const { return (int)m_ordered_weights_mask; }
4119 
4121  void SetOrderedWeight (int index, float weight) {
4122  m_ordered_weights[index] = weight;
4123  m_ordered_weights_mask |= 1<<index;
4124  }
4126  float GetOrderedWeight (int index) const { return m_ordered_weights[index]; }
4128  float const * GetOrderedWeights () const { return m_ordered_weights; }
4130  float * GetOrderedWeights () { return m_ordered_weights; }
4131 
4133  void SetSelectionLevel (int l) { m_selection_level = (unsigned char)l; }
4135  int GetSelectionLevel () const { return (int)m_selection_level; }
4136 
4138  void SetSelectionSorting (int s) { m_selection_sorting = (unsigned char)s; }
4140  int GetSelectionSorting () const { return (int)m_selection_sorting; }
4141 
4143  void SetForceDefer (int l) { m_force_defer = l; }
4145  int GetForceDefer () const { return m_force_defer; }
4146 
4147 };
4148 
4150 
4151 
4153 
4159 class BBINFILETK_API TK_Geometry_Options : public BBaseOpcodeHandler {
4160  protected:
4161  unsigned short m_mask;
4162  unsigned short m_value;
4163 
4165  float m_orientation[6];
4168 
4169  struct {
4170  unsigned char mask;
4171  unsigned char mode;
4172  float color[3];
4173  float alpha;
4174  float scale;
4175  } m_cut_visualization;
4176 
4177  public:
4179  TK_Geometry_Options () : BBaseOpcodeHandler (TKE_Geometry_Options),
4180  m_mask (0), m_value (0), m_orientation_count (0),
4181  m_coordinate_system_count (0), m_coordinate_systems (0) {
4182  m_cut_visualization.mask = 0;
4183  }
4184  ~TK_Geometry_Options ();
4185 
4186  void Reset ();
4187 
4190  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
4191 
4192  TK_Status ReadAscii (BStreamFileToolkit & tk);
4193  TK_Status WriteAscii (BStreamFileToolkit & tk);
4194 
4196  void SetMask (int m) { m_mask = (unsigned short)m; }
4198  int GetMask () const { return (int)m_mask; }
4199 
4201  void SetOrientation (int count, float const o[]) {
4202  if (count != 3 && count != 6)
4203  return;
4204  m_orientation_count = (unsigned char)count;
4205  while (count-- > 0)
4206  m_orientation[count] = o[count];
4207  }
4209  int GetOrientationCount () const { return (int) m_orientation_count; }
4211  float const * GetOrientation () const { return m_orientation; }
4212 
4214  void SetCoordinateSystems (int count, char const cs[]) {
4215  m_coordinate_system_count = count;
4216  m_coordinate_systems = new char [count];
4217  while (count-- > 0)
4218  m_coordinate_systems[count] = cs[count];
4219  }
4221  int GetCoordinateSystemCount () const { return m_coordinate_system_count; }
4223  char const * GetCoordinateSystems () const { return m_coordinate_systems; }
4224 
4225 
4226 
4228  void SetCutVisualizationMask (int m) { m_cut_visualization.mask = (unsigned char)m; }
4230  int GetCutVisualizationMask () const { return (int)m_cut_visualization.mask; }
4231 
4233  void SetCutVisualizationMode (int m) { m_cut_visualization.mode = (unsigned char)m; }
4235  int GetCutVisualizationMode () const { return (int)m_cut_visualization.mode; }
4236 
4238  void SetCutVisualizationColor (float const * c) {
4239  m_cut_visualization.color[0] = c[0];
4240  m_cut_visualization.color[1] = c[1];
4241  m_cut_visualization.color[2] = c[2];
4242  }
4244  float const * GetCutVisualizationColor () const { return m_cut_visualization.color; }
4245 
4247  void SetCutVisualizationAlpha (float a) { m_cut_visualization.alpha = a; }
4249  float GetCutVisualizationAlpha () const { return m_cut_visualization.alpha; }
4250 
4252  void SetCutVisualizationSCale (float s) { m_cut_visualization.scale = s; }
4254  float GetCutVisualizationScale () const { return m_cut_visualization.scale; }
4255 };
4256 
4259 
4264 class BBINFILETK_API TK_Visibility : public BBaseOpcodeHandler {
4265  protected:
4266  int m_mask;
4267  int m_value;
4268 
4269  public:
4272  : BBaseOpcodeHandler (TKE_Visibility), m_mask (0), m_value (0) {}
4273 
4276  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
4277 
4278  TK_Status ReadAscii (BStreamFileToolkit & tk);
4279  TK_Status WriteAscii (BStreamFileToolkit & tk);
4280 
4284  void SetGeometry (int m) {
4285  m_mask = m & TKO_Geo_All_Visibles;
4286  if ((m & TKO_Geo_Extended_Mask) != 0) {
4287  m_mask |= TKO_Geo_Extended;
4288  if ((m & TKO_Geo_Extended2_Mask) != 0)
4289  m_mask |= TKO_Geo_Extended2;
4290  }
4291  }
4296  int GetGeometry () const { return m_mask; }
4297 
4302  void SetValue (int m) { m_value = m; }
4307  int GetValue () const { return m_value; }
4308 };
4309 
4312 
4319 class BBINFILETK_API TK_Selectability : public BBaseOpcodeHandler {
4320  protected:
4321  int m_mask;
4322  int m_down;
4323  int m_up;
4327 
4328  public:
4331  : BBaseOpcodeHandler (TKE_Selectability),
4332  m_mask (0), m_down (0), m_up (0), m_move_down (0), m_move_up (0), m_invisible (0) {}
4333 
4336  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
4337 
4338  TK_Status ReadAscii (BStreamFileToolkit & tk);
4339  TK_Status WriteAscii (BStreamFileToolkit & tk);
4340 
4344  void SetGeometry (int m) {
4345  m_mask = m & TKO_Geo_All_Selects;
4346  if ((m & TKO_Geo_Extended_Mask) != 0)
4347  m_mask |= TKO_Geo_Extended;
4348  }
4353  int GetGeometry () const { return m_mask; }
4354 
4359  void SetDown (int m) { m_down = m; }
4364  int GetDown () const { return m_down; }
4365 
4370  void SetUp (int m) { m_up = m; }
4375  int GetUp () const { return m_up; }
4376 
4381  void SetMoveDown (int m) { m_move_down = m; }
4386  int GetMoveDown () const { return m_move_down; }
4387 
4392  void SetMoveUp (int m) { m_move_up = m; }
4397  int GetMoveUp () const { return m_move_up; }
4398 
4403  void SetWhenInvisible (int m) { m_invisible = m; }
4408  int GetWhenInvisible () const { return m_invisible; }
4409 };
4410 
4412 
4418 class BBINFILETK_API TK_Matrix : public BBaseOpcodeHandler {
4419  protected:
4420  float m_matrix[16];
4421  double m_dmatrix[16];
4422 
4423  public:
4425  TK_Matrix (unsigned char opcode)
4426  : BBaseOpcodeHandler (opcode) {}
4427 
4430  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
4431 
4432  TK_Status ReadAscii (BStreamFileToolkit & tk);
4433  TK_Status WriteAscii (BStreamFileToolkit & tk);
4434 
4436  void SetMatrix (float const m[]) {
4437  int i; for (i=0; i<16; i++) m_matrix[i] = m[i];
4438  }
4440  void SetDMatrix (double const m[]) {
4441  int i; for (i=0; i<16; i++) m_dmatrix[i] = m[i];
4442  }
4444  float const * GetMatrix () const { return m_matrix; }
4446  float * GetMatrix () { return m_matrix; }
4448  double const * GetDMatrix () const { return m_dmatrix; }
4450  double * GetDMatrix () { return m_dmatrix; }
4451 };
4452 
4453 
4459 class BBINFILETK_API TK_Enumerated : public BBaseOpcodeHandler {
4460  protected:
4461  char m_index;
4462 
4463  public:
4465  TK_Enumerated (unsigned char opcode)
4466  : BBaseOpcodeHandler (opcode), m_index (0) {}
4467 
4470  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
4471 
4472  TK_Status ReadAscii (BStreamFileToolkit & tk);
4473  TK_Status WriteAscii (BStreamFileToolkit & tk);
4474 
4475  void SetIndex (int i) { m_index = (char)i; }
4477  int GetIndex () const { return (int)m_index; }
4478 };
4479 
4480 
4486 class BBINFILETK_API TK_Size : public BBaseOpcodeHandler {
4487  protected:
4488  float m_value;
4489  unsigned char m_units;
4490 
4491  public:
4493  TK_Size (unsigned char opcode)
4494  : BBaseOpcodeHandler (opcode), m_value (0.0f), m_units (TKO_Generic_Size_Unspecified) {}
4495 
4498  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
4499 
4500  TK_Status ReadAscii (BStreamFileToolkit & tk);
4501  TK_Status WriteAscii (BStreamFileToolkit & tk);
4502 
4504  void SetSize (float value, int units = TKO_Generic_Size_Unspecified) {
4505  m_value = (value > 0.0f) ? value : 0.0f;
4506  m_units = (m_value > 0.0f) ? (unsigned char) units : (unsigned char) TKO_Generic_Size_Unspecified;
4507  }
4509  float GetSize () const { return m_value; }
4511  int GetUnits () const { return m_units; }
4512 };
4513 
4518 class BBINFILETK_API TK_Linear_Pattern : public BBaseOpcodeHandler {
4519  protected:
4520  unsigned short m_pattern;
4521 
4522  public:
4524  TK_Linear_Pattern (unsigned char opcode)
4525  : BBaseOpcodeHandler (opcode), m_pattern (0) {}
4526 
4529  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
4530 
4531  TK_Status ReadAscii (BStreamFileToolkit & tk);
4532  TK_Status WriteAscii (BStreamFileToolkit & tk);
4533 
4535  void SetPattern (int p) { m_pattern = (unsigned short)p; }
4537  int GetPattern () const { return (int)m_pattern; }
4538 };
4539 
4545 class BBINFILETK_API TK_Named : public BBaseOpcodeHandler {
4546  protected:
4548  char * m_name;
4549  int m_index;
4550 
4551  public:
4553  TK_Named (unsigned char opcode)
4554  : BBaseOpcodeHandler (opcode), m_name_length (0), m_name (0), m_index (0) {}
4555  ~TK_Named();
4556 
4559  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
4560 
4561  TK_Status ReadAscii (BStreamFileToolkit & tk);
4562  TK_Status WriteAscii (BStreamFileToolkit & tk);
4563 
4564  void Reset ();
4565 
4567  void SetName (char const * name);
4569  void SetName (int length);
4571  char const * GetName () const { return m_name; }
4573  char * GetName () { return m_name; }
4574 
4576  void SetIndex (int i) { Reset(); m_index = i; }
4578  int GetIndex () const { return (int)m_index; }
4579 };
4580 
4581 
4582 
4589 class BBINFILETK_API TK_Streaming : public BBaseOpcodeHandler {
4590  protected:
4591  bool m_flag;
4592 
4593  public:
4596 
4599  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
4600 
4601  TK_Status ReadAscii (BStreamFileToolkit & tk);
4602  TK_Status WriteAscii (BStreamFileToolkit & tk);
4603 
4604  void SetStreaming (bool s) { m_flag = s; }
4606  bool GetStreaming () const { return m_flag; }
4607 };
4608 
4611 
4617 class BBINFILETK_API TK_Conditions : public BBaseOpcodeHandler {
4618  protected:
4619  int m_length;
4620  char * m_string;
4622  public:
4624  TK_Conditions () : BBaseOpcodeHandler (TKE_Conditions), m_length (0), m_string (0) {}
4625  ~TK_Conditions();
4626 
4629  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
4630 
4631  TK_Status ReadAscii (BStreamFileToolkit & tk);
4632  TK_Status WriteAscii (BStreamFileToolkit & tk);
4633 
4634  void Reset ();
4635 
4637  void SetConditions (char const * options);
4639  void SetConditions (int length);
4641  char const * GetConditions () const { return m_string; }
4643  char * GetConditions () { return m_string; }
4645  int GetLength() { return m_length; }
4646 };
4647 
4648 
4651 
4656 class BBINFILETK_API TK_Conditional_Action : public BBaseOpcodeHandler {
4657  protected:
4658  short m_type;
4659  short m_options;
4660  int m_length;
4661  char * m_string;
4663  public:
4665  TK_Conditional_Action () : BBaseOpcodeHandler (TKE_Conditional_Action), m_length (0), m_string (0) {}
4667 
4670  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
4671 
4672  TK_Status ReadAscii (BStreamFileToolkit & tk);
4673  TK_Status WriteAscii (BStreamFileToolkit & tk);
4674 
4675  void Reset ();
4676 
4678  void SetCondition (char const * options);
4680  void SetCondition (int length);
4682  char const * GetCondition () const { return m_string; }
4684  char * GetCondition () { return m_string; }
4686  int GetLength() { return m_length; }
4687 
4689  void SetAction (int at) { m_type = (short)at; }
4691  int GetAction () const { return (int)m_type; }
4693  void SetOptions (int at) { m_options = (short)at; }
4695  int GetOptions () const { return (int)m_options; }
4696 };
4697 
4700 
4706 class BBINFILETK_API TK_User_Options : public BBaseOpcodeHandler {
4707  protected:
4708  int m_length;
4709  char * m_string;
4714  void set_options (char const * options);
4715  void set_options (int length);
4716 
4717  public:
4719  TK_User_Options () : BBaseOpcodeHandler (TKE_User_Options), m_length (0), m_string (0),
4720  m_indices (0), m_unicode (0), m_index_data(0) {}
4721  ~TK_User_Options();
4722 
4725  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
4726 
4727  TK_Status ReadAscii (BStreamFileToolkit & tk);
4728  TK_Status WriteAscii (BStreamFileToolkit & tk);
4729 
4730  void Reset ();
4731 
4733  void SetOptions (char const * options) { set_options (options); }
4735  void SetOptions (int length) { set_options (length); }
4737  char const * GetOptions () const { return m_string; }
4739  char * GetOptions () { return m_string; }
4741  int GetLength() { return m_length; }
4742 };
4743 
4746 
4752 class BBINFILETK_API TK_Unicode_Options : public BBaseOpcodeHandler {
4753  protected:
4754  int m_length;
4755  unsigned short * m_string;
4757  public:
4759  TK_Unicode_Options () : BBaseOpcodeHandler (TKE_Unicode_Options), m_length (0), m_string (0) {}
4760  ~TK_Unicode_Options();
4761 
4764  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
4765 
4766  TK_Status ReadAscii (BStreamFileToolkit & tk);
4767  TK_Status WriteAscii (BStreamFileToolkit & tk);
4768 
4769  void Reset ();
4770 
4772  void SetOptions (unsigned short const * options);
4774  void SetOptions (int length);
4776  unsigned short const * GetOptions () const { return m_string; }
4778  unsigned short * GetOptions () { return m_string; }
4780  int GetLength() { return m_length; }
4781 };
4782 
4784 
4790 class BBINFILETK_API TK_User_Index : public BBaseOpcodeHandler {
4791  protected:
4792  int m_count;
4793  int * m_indices;
4794  HLONG * m_values;
4796  void set_indices (int count, int const indices[], POINTER_SIZED_INT const values[]);
4797  void set_indices (int count);
4798 
4799  public:
4802  : BBaseOpcodeHandler (TKE_User_Index), m_count (0), m_indices (0), m_values (0), m_current_value(0) {}
4803  ~TK_User_Index();
4804 
4807  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
4808 
4809  TK_Status ReadAscii (BStreamFileToolkit & tk);
4810  TK_Status WriteAscii (BStreamFileToolkit & tk);
4811 
4812  void Reset ();
4813 
4815  void SetIndices (int count, int const indices[], POINTER_SIZED_INT const values[])
4816  { set_indices (count, indices, values); }
4818  void SetIndices (int count) { set_indices (count); }
4820  int GetCount () const { return m_count; }
4822  int const * GetIndices () const { return m_indices; }
4824  int * GetIndices () { return m_indices; }
4826  HLONG const * GetValues () const { return m_values; }
4828  HLONG * GetValues () { return m_values; }
4829 };
4830 
4832 
4838 class BBINFILETK_API TK_User_Index_Data : public BBaseOpcodeHandler {
4839 protected:
4840  int m_count;
4841  int * m_indices;
4842  void ** m_values;
4843  int * m_sizes;
4844 
4846  void set_indices (int count, int const indices[], void const * values[], int const sizes[]);
4847  void set_indices (int count);
4848  void FreeMem ();
4849 
4850 public:
4853  : BBaseOpcodeHandler (TKE_User_Index_Data), m_count (0), m_indices (0), m_values (0), m_sizes(0), m_current_value(0) {}
4854  ~TK_User_Index_Data();
4855 
4858  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
4859 
4860  void Reset ();
4861 
4863  void SetIndices (int count, int const indices[], void const * values[], int const sizes[]) {
4864  set_indices (count, indices, values, sizes);
4865  }
4866 
4868  void SetIndices (int count) { set_indices (count);}
4869 
4871  int GetCount () const { return m_count;}
4872 
4874  int const * GetIndices () const { return m_indices;}
4875 
4877  int * GetIndices () { return m_indices;}
4878 
4880  void ** GetValues () const { return m_values;}
4881 
4883  void ** GetValues () { return m_values;}
4884 
4886  int const * GetSizes () const { return m_sizes;}
4887 
4889  int * GetSizes () { return m_sizes;}
4890 };
4891 
4892 
4894 
4899 class BBINFILETK_API TK_User_Value : public BBaseOpcodeHandler {
4900  protected:
4901  HLONG m_value;
4902 
4903  public:
4906  : BBaseOpcodeHandler (TKE_User_Value), m_value (0) {}
4907 
4910  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
4911 
4912  TK_Status ReadAscii (BStreamFileToolkit & tk);
4913  TK_Status WriteAscii (BStreamFileToolkit & tk);
4914 
4916  void SetValue (HLONG v) { m_value = v; }
4918  HLONG GetValue () const { return m_value; }
4919 };
4920 
4921 
4923 
4928 class BBINFILETK_API2 TK_Camera : public BBaseOpcodeHandler {
4929  protected:
4933  float m_settings[14];
4935  double m_dsettings[14];
4937  float m_details[3];
4938  unsigned char m_projection;
4939  int m_length;
4940  char * m_name;
4943  void set_name (char const * name);
4944 
4945  void set_name (int length);
4946 
4947  public:
4949  TK_Camera (unsigned char opcode = TKE_Camera)
4950  : BBaseOpcodeHandler (opcode), m_length (0), m_name (0) {
4951  int i;
4952  int count = (int)(sizeof(m_settings) / sizeof(m_settings[0]));
4953  for (i = 0; i < count; i++) {
4954  m_settings[i] = 0;
4955  m_dsettings[i] = 0;
4956  }
4957  }
4958  ~TK_Camera();
4959 
4962  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
4963 
4964  TK_Status ReadAscii (BStreamFileToolkit & tk);
4965  TK_Status WriteAscii (BStreamFileToolkit & tk);
4966 
4968  void SetPosition (float x, float y, float z)
4969  { m_settings[0] = x; m_settings[1] = y; m_settings[2] = z; }
4971  void SetPosition (float const p[]) { SetPosition (p[0], p[1], p[2]); }
4973  float const * GetPosition () const { return &m_settings[0]; }
4975  void GetPosition (float p[]) const { memcpy(p, GetPosition(), 3*sizeof(float)); }
4976 
4978  void SetDPosition (double x, double y, double z)
4979  { m_dsettings[0] = x; m_dsettings[1] = y; m_dsettings[2] = z; }
4981  void SetDPosition (double const p[]) { SetDPosition (p[0], p[1], p[2]); }
4983  double const * GetDPosition () const { return &m_dsettings[0]; }
4985  void GetDPosition (double p[]) const { memcpy(p, GetDPosition(), 3*sizeof(double)); }
4986 
4988  void SetTarget (float x, float y, float z)
4989  { m_settings[3] = x; m_settings[4] = y; m_settings[5] = z; }
4991  void SetTarget (float const t[]) { SetTarget (t[0], t[1], t[2]); }
4993  float const * GetTarget () const { return &m_settings[3]; }
4995  void GetTarget (float t[]) const { memcpy(t, GetTarget(), 3*sizeof(float)); }
4996 
4998  void SetDTarget (double x, double y, double z)
4999  { m_dsettings[3] = x; m_dsettings[4] = y; m_dsettings[5] = z; }
5001  void SetDTarget (double const t[]) { SetDTarget (t[0], t[1], t[2]); }
5003  double const * GetDTarget () const { return &m_dsettings[3]; }
5005  void GetDTarget (double t[]) const { memcpy(t, GetDTarget(), 3*sizeof(double)); }
5006 
5008  void SetUpVector (float x, float y, float z)
5009  { m_settings[6] = x; m_settings[7] = y; m_settings[8] = z; }
5011  void SetUpVector (float const u[]) { SetUpVector (u[0], u[1], u[2]); }
5013  float const * GetUpVector () const { return &m_settings[6]; }
5015  void GetUpVector (float u[]) const { memcpy(u,GetUpVector(),3*sizeof(float)); }
5016 
5018  void SetDUpVector (double x, double y, double z)
5019  { m_dsettings[6] = x; m_dsettings[7] = y; m_dsettings[8] = z; }
5021  void SetDUpVector (double const u[]) { SetDUpVector (u[0], u[1], u[2]); }
5023  double const * GetDUpVector () const { return &m_dsettings[6]; }
5025  void GetDUpVector (double u[]) const { memcpy(u, GetDUpVector(), 3*sizeof(double)); }
5026 
5028  void SetField (float w, float h) { m_settings[9] = w; m_settings[10] = h; }
5030  void SetField (float const f[]) { SetField (f[0], f[1]); }
5032  float const * GetField () const { return &m_settings[9]; }
5034  void GetField (float f[]) const { memcpy(f,GetField(),2*sizeof(float)); }
5035 
5037  void SetDField (double w, double h) { m_dsettings[9] = w; m_dsettings[10] = h; }
5039  void SetDField (double const f[]) { SetDField (f[0], f[1]); }
5041  double const * GetDField () const { return &m_dsettings[9]; }
5043  void GetDField (double f[]) const { memcpy(f, GetDField(), 2*sizeof(double)); }
5044 
5045 
5047  void SetOblique (float h, float v) { m_details[0] = h; m_details[1] = v;
5048  m_projection &= ~TKO_Camera_Oblique_Mask;
5049  if (h != 0.0f) m_projection |= TKO_Camera_Oblique_Y;
5050  if (v != 0.0f) m_projection |= TKO_Camera_Oblique_Mask;
5051  }
5053  void SetOblique (float const o[]) { SetOblique (o[0], o[1]); }
5055  float const * GetOblique () const { return m_details; }
5057  void GetOblique (float o[]) const { memcpy(o, GetOblique(), 2*sizeof(float)); }
5058 
5060  void SetNearLimit (float l) { m_details[2] = l;
5061  m_projection &= ~TKO_Camera_Near_Limit;
5062  if (l != 0.0f) m_projection |= TKO_Camera_Near_Limit;
5063  }
5065  float GetNearLimit () const { return m_details[2]; }
5066 
5067 
5069  void SetProjection (int p) { m_projection = (char)p; }
5071  int GetProjection () const { return (int)m_projection; }
5072 
5073 
5075  void SetView (char const * name) { set_name (name); }
5077  void SetView (int length) { set_name (length); }
5079  char const * GetView () const { return m_name; }
5081  char * GetView () { return m_name; }
5082 };
5083 
5085 
5090 class BBINFILETK_API TK_Window : public BBaseOpcodeHandler {
5091  protected:
5092  float m_window[8];
5093  unsigned char m_options;
5094 
5095  public:
5098  : BBaseOpcodeHandler (TKE_Window), m_options (0) {}
5099 
5102  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
5103 
5104  TK_Status ReadAscii (BStreamFileToolkit & tk);
5105  TK_Status WriteAscii (BStreamFileToolkit & tk);
5106 
5108  void SetWindow (float l, float r, float b, float t,
5109  float lo = 0, float ro = 0, float bo = 0, float to = 0)
5110  { m_window[0] = l; m_window[1] = r; m_window[2] = b; m_window[3] = t;
5111  m_window[4] = lo; m_window[5] = ro; m_window[6] = bo; m_window[7] = to; }
5113  void SetWindow (float const w[]) { SetWindow (w[0], w[1], w[2], w[3]); }
5115  void SetWindow (float const w[], float const o[])
5116  { SetWindow (w[0], w[1], w[2], w[3], o[0], o[1], o[2], o[3]); }
5118  void SetWindow (int n, float const w[])
5119  { if (n == 8) SetWindow (w[0], w[1], w[2], w[4], w[5], w[6], w[7], w[8]);
5120  else SetWindow (w[0], w[1], w[2], w[3]);
5121  }
5123  float const * GetWindow () const { return m_window; }
5124 
5126  void SetOptions (int opt) { m_options = (unsigned char)opt; }
5128  int GetOptions () const { return m_options; }
5129 };
5130 
5131 
5132 
5134 
5141 class BBINFILETK_API TK_Text_Font : public BBaseOpcodeHandler {
5142  protected:
5143  int m_mask;
5144  int m_value;
5146  char * m_names;
5147  float m_size;
5148  float m_tolerance;
5149  float m_rotation;
5150  float m_slant;
5157  int m_renderers[2];
5158  int m_preferences[2];
5161  char * m_shape;
5162  char * m_style;
5164  float m_margins[4];
5165  unsigned char m_margin_units[4];
5166  unsigned char m_size_units;
5167  unsigned char m_tolerance_units;
5168  unsigned char m_space_units;
5169  unsigned char m_greeking_units;
5170  unsigned char m_greeking_mode;
5171  unsigned char m_transforms;
5172  unsigned char m_renderer_cutoff_units;
5174  unsigned char m_layout;
5175 
5176  void set_names (int length);
5177  void set_names (char const * names);
5178 
5179  public:
5182  : BBaseOpcodeHandler (TKE_Text_Font), m_names_length (0), m_names (0)
5183  , m_shape_length (0), m_style_length (0), m_shape (0), m_style (0) {}
5184  ~TK_Text_Font ();
5185 
5188  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
5189 
5190  TK_Status ReadAscii (BStreamFileToolkit & tk);
5191  TK_Status WriteAscii (BStreamFileToolkit & tk);
5192 
5193  void Reset ();
5194 
5196  void SetMask (int m) {
5197  m_mask = m;
5198  if ((m & TKO_Font_Extended2_Mask) != 0)
5199  m_mask |= TKO_Font_Extended2;
5200  if ((m & TKO_Font_Extended_Mask) != 0)
5201  m_mask |= TKO_Font_Extended;
5202  }
5204  int GetMask () const { return m_mask; }
5205 
5207  void SetValue (int v) { m_value = v; }
5209  int GetValue () const { return m_value; }
5210 
5212  void SetNames (char const * names) { set_names (names); }
5214  void SetNames (int length) { set_names (length); }
5216  char const * GetNames () const { return m_names; }
5218  char * GetNames () { return m_names; }
5219 
5221  void SetShape (char const * shape);
5223  void SetShape (int length);
5225  char const * GetShape () const { return m_shape; }
5227  char * GetShape () { return m_shape; }
5228 
5230  void SetStyle (char const * shape);
5232  void SetStyle (int length);
5234  char const * GetStyle () const { return m_style; }
5236  char * GetStyle () { return m_style; }
5237 
5239  void SetSize (float s) { m_size = s; }
5241  float GetSize () const { return m_size; }
5242 
5244  void SetSizeUnits (int u) { m_size_units = (unsigned char)u; }
5246  int GetSizeUnits () const { return (int)m_size_units; }
5247 
5249  void SetTolerance (float t) { m_tolerance = t; }
5251  float GetTolerance () const { return m_tolerance; }
5252 
5254  void SetToleranceUnits (int u) { m_tolerance_units = (unsigned char)u; }
5256  int GetToleranceUnits () const { return (int)m_tolerance_units; }
5257 
5259  void SetRotation (float r) { m_rotation = r; }
5261  float GetRotation () const { return m_rotation; }
5262 
5264  void SetSlant (float s) { m_slant = s; }
5266  float GetSlant () const { return m_slant; }
5267 
5269  void SetWidthScale (float s) { m_width_scale = s; }
5271  float GetWidthScale () const { return m_width_scale; }
5272 
5274  void SetExtraSpace (float s) { m_extra_space = s; }
5276  float GetExtraSpace () const { return m_extra_space; }
5277 
5279  void SetExtraSpaceUnits (int u) { m_space_units = (unsigned char)u; }
5281  int GetExtraSpaceUnits () const { return (int)m_space_units; }
5282 
5284  void SetLineSpacing (float s) { m_line_spacing = s; }
5286  float GetLineSpacing () const { return m_line_spacing; }
5287 
5289  void SetTransforms (int t) { m_transforms = (unsigned char)t; }
5291  int GetTransforms () const { return (int)m_transforms; }
5292 
5294  void SetGreekingLimit (float s) { m_greeking_limit = s; }
5296  float GetGreekingLimit () const { return m_greeking_limit; }
5297 
5299  void SetGreekingLimitUnits (int u) { m_greeking_units = (unsigned char)u; }
5301  int GetGreekingLimitUnits () const { return (int)m_greeking_units; }
5302 
5304  void SetGreekingMode (int m) { m_greeking_mode = (unsigned char)m; }
5306  int GetGreekingMode () const { return (int)m_greeking_mode; }
5307 
5308 
5310  void SetRenderer (int r) { m_renderers[0] = m_renderers[1] = r; }
5312  int GetRenderer () const { return m_renderers[0]; }
5313 
5315  void SetRenderers (int r1, int r2) { m_renderers[0] = r1; m_renderers[1] = r2; }
5317  int const * GetRenderers () const { return m_renderers; }
5318 
5320  void SetRendererCutoff (float s) { m_renderer_cutoff = s; }
5322  float GetRendererCutoff () const { return m_renderer_cutoff; }
5323 
5325  void SetRendererCutoffUnits (int u) { m_renderer_cutoff_units = (unsigned char)u; }
5327  int GetRendererCutoffUnits () const { return (int)m_renderer_cutoff_units; }
5328 
5329 
5331  void SetPreference (int r) { m_preferences[0] = m_preferences[1] = r; }
5333  int GetPreference () const { return m_preferences[0]; }
5334 
5336  void SetPreferences (int r1, int r2) { m_preferences[0] = r1; m_preferences[1] = r2; }
5338  int const * GetPreferences () const { return m_preferences; }
5339 
5341  void SetPreferenceCutoff (float s) { m_preference_cutoff = s; }
5343  float GetPreferenceCutoff () const { return m_preference_cutoff; }
5344 
5346  void SetPreferenceCutoffUnits (int u) { m_preference_cutoff_units = (unsigned char)u; }
5348  int GetPreferenceCutoffUnits () const { return (int)m_preference_cutoff_units; }
5349 
5351  void SetLayout (int l) {m_layout = (unsigned char)l;}
5353  int GetLayout () const {return (int)m_layout;}
5354 };
5355 
5357 
5359 
5369 
5381 class BBINFILETK_API2 TK_Bounding : public BBaseOpcodeHandler {
5382  protected:
5383  double m_dvalues[6];
5384  float m_values[6];
5385  char m_type;
5386  bool m_is_valid;
5387  public:
5389  TK_Bounding (unsigned char opcode)
5390  : BBaseOpcodeHandler (opcode) {}
5392  TK_Bounding (unsigned char opcode, float min[], float max[])
5393  : BBaseOpcodeHandler (opcode), m_type (TKO_Bounding_Type_Cuboid), m_is_valid (true) {
5394  m_values[0] = min[0]; m_values[1] = min[1]; m_values[2] = min[2];
5395  m_values[3] = max[0]; m_values[4] = max[1]; m_values[5] = max[2];
5396  }
5398  TK_Bounding (unsigned char opcode, float center[], float radius)
5399  : BBaseOpcodeHandler (opcode), m_type (TKO_Bounding_Type_Sphere), m_is_valid (true) {
5400  m_values[0] = center[0]; m_values[1] = center[1]; m_values[2] = center[2];
5401  m_values[3] = radius;
5402  }
5404  TK_Bounding (unsigned char opcode, double min[], double max[])
5405  : BBaseOpcodeHandler (opcode), m_type (TKO_Bounding_Type_Cuboid), m_is_valid (true) {
5406  m_dvalues[0] = min[0]; m_dvalues[1] = min[1]; m_dvalues[2] = min[2];
5407  m_dvalues[3] = max[0]; m_dvalues[4] = max[1]; m_dvalues[5] = max[2];
5409  }
5411  TK_Bounding (unsigned char opcode, double center[], double radius)
5412  : BBaseOpcodeHandler (opcode), m_type (TKO_Bounding_Type_Sphere), m_is_valid (true) {
5413  m_dvalues[0] = center[0]; m_dvalues[1] = center[1]; m_dvalues[2] = center[2];
5414  m_dvalues[3] = radius;
5416  }
5417 
5420  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
5421 
5422  TK_Status ReadAscii (BStreamFileToolkit & tk);
5423  TK_Status WriteAscii (BStreamFileToolkit & tk);
5424 };
5425 
5427 
5429 
5435 class BBINFILETK_API TK_Point : public BBaseOpcodeHandler {
5436  protected:
5437  float m_point[3];
5438  double m_dpoint[3];
5439  char m_options;
5440 
5441  public:
5443  TK_Point (unsigned char opcode)
5444  : BBaseOpcodeHandler (opcode) {
5445  m_point[0] = m_point[1] = m_point[2] = 0;
5446  m_dpoint[0] = m_dpoint[1] = m_dpoint[2] = 0;
5447  m_options = 0;
5448  };
5449 
5452  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
5453 
5454  TK_Status ReadAscii (BStreamFileToolkit & tk);
5455  TK_Status WriteAscii (BStreamFileToolkit & tk);
5456 
5457  void Reset(void) {
5458  m_point[0] = m_point[1] = m_point[2] = 0;
5459  m_dpoint[0] = m_dpoint[1] = m_dpoint[2] = 0;
5460  m_options = 0;
5462  };
5463 
5464 
5465 
5467  void SetPoint (float x, float y, float z) { m_point[0] = x; m_point[1] = y; m_point[2] = z; }
5469  void SetPoint (float const p[]) { SetPoint (p[0], p[1], p[2]); }
5471  float const * GetPoint () const { return m_point; }
5472 
5474  void SetDPoint (double x, double y, double z) { m_dpoint[0] = x; m_dpoint[1] = y; m_dpoint[2] = z; }
5476  void SetDPoint (double const p[]) { SetDPoint (p[0], p[1], p[2]); }
5478  double const * GetDPoint () const { return m_dpoint; }
5479 
5481  void SetOptions (int o) { m_options = (char)o; }
5483  int GetOptions () const { return (int)m_options; }
5484 
5485 };
5486 
5487 
5488 
5490 
5495 class BBINFILETK_API TK_Line : public BBaseOpcodeHandler {
5496  protected:
5498  float m_points[6];
5500  double m_dpoints[6];
5501 
5502  public:
5504  TK_Line (unsigned char opcode = TKE_Line)
5505  : BBaseOpcodeHandler (opcode) {}
5506 
5509  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
5510 
5511  TK_Status ReadAscii (BStreamFileToolkit & tk);
5512  TK_Status WriteAscii (BStreamFileToolkit & tk);
5513 
5515  void SetPoints (float x1, float y1, float z1, float x2, float y2, float z2) {
5516  m_points[0] = x1; m_points[1] = y1; m_points[2] = z1;
5517  m_points[3] = x2; m_points[4] = y2; m_points[5] = z2;
5518  }
5520  void SetPoints (float const s[], float const e[]) {
5521  SetPoints (s[0], s[1], s[2], e[0], e[1], e[2]);
5522  }
5524  void SetPoints (float const p[]) { SetPoints (&p[0], &p[3]); }
5526  float const * GetPoints () const { return m_points; }
5527 
5529  void SetDPoints (double x1, double y1, double z1, double x2, double y2, double z2) {
5530  m_dpoints[0] = x1; m_dpoints[1] = y1; m_dpoints[2] = z1;
5531  m_dpoints[3] = x2; m_dpoints[4] = y2; m_dpoints[5] = z2;
5532  }
5534  void SetDPoints (double const s[], double const e[]) {
5535  SetDPoints (s[0], s[1], s[2], e[0], e[1], e[2]);
5536  }
5538  void SetDPoints (double const p[]) { SetDPoints (&p[0], &p[3]); }
5540  double const * GetDPoints () const { return m_dpoints; }
5541 
5542 };
5543 
5544 
5545 
5547 
5554 class BBINFILETK_API TK_Polypoint : public BBaseOpcodeHandler {
5555  protected:
5556  int m_count;
5558  float * m_points;
5559  double * m_dpoints;
5562  void set_points (int count, float const points[] = 0) { SetPoints (count, points); }
5563  public:
5567  TK_Polypoint (unsigned char opcode)
5568  : BBaseOpcodeHandler (opcode), m_count (0), m_allocated (0), m_points (0), m_dpoints (0) {}
5569  ~TK_Polypoint();
5570 
5573  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
5574 
5575  TK_Status ReadAscii (BStreamFileToolkit & tk);
5576  TK_Status WriteAscii (BStreamFileToolkit & tk);
5577 
5578  void Reset ();
5579 
5582  void SetPoints (int count, float const points[] = 0);
5584  float const * GetPoints () const { return m_points; }
5586  float * GetPoints () { return m_points; }
5587 
5590  void SetDPoints (int count, double const points[] = 0);
5592  double const * GetDPoints () const { return m_dpoints; }
5594  double * GetDPoints () { return m_dpoints; }
5595 
5597  int GetCount () const { return m_count; }
5598 
5599 };
5600 
5601 
5602 
5603 
5604 #define NC_HAS_WEIGHTS 0x01
5605 #define NC_HAS_KNOTS 0x02
5606 #define NC_HAS_START 0x04
5607 #define NC_HAS_END 0x08
5608 
5609 
5615 class BBINFILETK_API TK_NURBS_Curve : public BBaseOpcodeHandler {
5616  protected:
5617  unsigned char m_optionals;
5618  unsigned char m_degree;
5623  float *m_weights;
5624  float *m_knots;
5625  float m_start;
5626  float m_end;
5628  void set_curve (int degree, int control_count, float const points[] = 0,
5630  float const weights[] = 0, float const knots[] = 0,
5631  float start = 0.0f, float end = 1.0f);
5632  public:
5633  TK_NURBS_Curve();
5634  ~TK_NURBS_Curve();
5635 
5638  TK_Status Clone (BStreamFileToolkit & tk, BBaseOpcodeHandler **handler) const;
5639 
5640  TK_Status ReadAscii (BStreamFileToolkit & tk);
5641  TK_Status WriteAscii (BStreamFileToolkit & tk);
5642 
5643  void Reset ();
5644 
5646  void SetCurve (int degree, int control_count, float const points[] = 0,
5647  float const weights[] = 0, float const knots[] = 0,
5648  float start = 0.0f, float end = 1.0f) {
5649  set_curve (degree, control_count, points, weights, knots, start, end);
5650  }
5651  void SetDCurve (int degree, int control_count, double const points[] = 0,
5652  float const weights[] = 0, float const knots[] = 0,
5653  float start = 0.0f, float end = 1.0f);
5654 
5655  float const * GetPoints () const { return m_control_points; }
5656  float * GetPoints () { return m_control_points; }
5657  double const * GetDPoints () const { return m_dcontrol_points; }
5658  double * GetDPoints () { return m_dcontrol_points; }
5660  int GetDegree () const { return m_degree; }
5661  int GetCount () const { return m_control_point_count; }
5662  float const * GetWeights () const { return m_weights; }
5663  float * GetWeights () { return m_weights; }
5664  float const * GetKnots () const { return m_knots; }
5665  float * GetKnots () { return m_knots; }
5667  void SetStart (float s) { m_start = s; }
5668  float GetStart () const { return m_start; }
5669  void SetEnd (float e) { m_end = e; }
5670  float GetEnd () const { return m_end; }
5672  void SetOptions (int o) { m_optionals = (unsigned char)o; }
5673  int GetOptions () const { return m_optionals; }
5675 };
5676 
5677 
5678 
5679 
5680 
5681 #define NS_HAS_WEIGHTS 0x01
5682 #define NS_HAS_KNOTS 0x02
5683 #define NS_HAS_TRIMS 0x04
5684 
5685 #define NS_TRIM_END 0
5686 #define NS_TRIM_POLY 1
5687 #define NS_TRIM_CURVE 2
5688 #define NS_TRIM_COLLECTION 3
5689 #define NS_TRIM_LAST_KNOWN_TYPE 3
5690 
5691 #define NS_TRIM_KEEP 0x01
5692 #define NS_TRIM_HAS_WEIGHTS 0x02
5693 #define NS_TRIM_HAS_KNOTS 0x04
5694 
5695 
5702 class BBINFILETK_API HT_NURBS_Trim : public BBaseOpcodeHandler {
5703  friend class TK_NURBS_Surface;
5704  protected:
5705  //first 5 are relevant to polys and curves
5708  unsigned char m_type;
5709  int m_count;
5710  float * m_points;
5711  //next 6 are specific to curves
5712  unsigned char m_degree;
5713  unsigned char m_options;
5714  float * m_weights;
5715  float * m_knots;
5716  float m_start_u;
5717  float m_end_u;
5721  HT_NURBS_Trim();
5722  TK_Status read_collection(BStreamFileToolkit & tk);
5723  TK_Status write_collection(BStreamFileToolkit & tk);
5726  public:
5727  ~HT_NURBS_Trim();
5728  void SetPoly (int count, float const points[] = 0);
5729  void SetCurve (int degree, int control_count, float const points[] = 0,
5730  float const weights[] = 0, float const knots[] = 0, float start_u = 0, float end_u = 1);
5731  void SetCollection ();
5732  HT_NURBS_Trim * PrependCollection();
5733  void SetOptions (int o) { m_options = (unsigned char)o; }
5734  void SetList (HT_NURBS_Trim *node) { m_list = node; }
5735  void SetNext (HT_NURBS_Trim *next) { m_next = next; }
5736  void SetStart(float start) { m_start_u = start; }
5737  void SetEnd(float end) { m_end_u = end; }
5738 
5741 
5744 
5745  TK_Status read_collection_ascii(BStreamFileToolkit & tk);
5746  TK_Status write_collection_ascii(BStreamFileToolkit & tk);
5747 
5749  HT_NURBS_Trim * GetNext (void) { return m_next; }
5750  HT_NURBS_Trim const * GetNext (void) const { return m_next; }
5752  int GetType () const { return m_type; }
5754  int GetCount () const { return m_count; }
5756  float const * GetPoints () const { return m_points; }
5758  float * GetPoints () { return m_points; }
5760  int GetDegree () const { return m_degree; }
5762  float GetStart() const { return m_start_u; }
5764  float GetEnd() const { return m_end_u; }
5766  int GetOptions () const { return m_options; }
5768  float const * GetWeights () const { return m_weights; }
5770  float * GetWeights () { return m_weights; }
5772  float const * GetKnots () const { return m_knots; }
5774  float * GetKnots () { return m_knots; }
5776  HT_NURBS_Trim const *GetList () const { return m_list; }
5778  HT_NURBS_Trim * GetList () { return m_list; }
5779 
5780 };
5781 
5783 
5788 class BBINFILETK_API TK_NURBS_Surface : public BBaseOpcodeHandler {
5789  protected:
5790  unsigned char m_optionals;
5791  unsigned char m_degree[2];
5792  int m_size[2];
5795  float * m_weights