VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
rwLocationReference.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2023 MaK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
10 #include "readerWriter/rwVector.h"
11 #include "readerWriter/rwInt.h"
12 #include "vrfutil/rwUUID.h"
13 
14 
16 
17 namespace DtBufferSerialize
18 {
20  DT_DLL_vrfutil const char *decode(DtRwLocationReference& val, const char *buffer);
21  DT_DLL_vrfutil char *encode(const DtRwLocationReference& val, char *buffer);
22 }
23 
26 {
27 public:
29  {
30  Location_Absolute = 0,
31  Location_Object = 1
32  };
33 
35  static DtString locationTypeString(LocationType posType);
38  static LocationType stringToLocationType(const DtString& s, bool& valid);
39 
40  //Default constructor
42 
43  //Real constructors
44  DtRwLocationReference(const DtString& name,
45  DtReaderWriterRegistry* parentRegistry = nullptr);
47  DtReaderWriterRegistry* parentRegistry = nullptr);
48 
51 
52  virtual ~DtRwLocationReference();
53 
54  virtual const char* readerWriterType() const override;
55 
58 
59  virtual LocationType locationType() const;
60  virtual void setLocationType(LocationType posType);
62 
65 
66  virtual DtUUID object() const;
67  virtual void setObject(const DtUUID& object);
69 
72 
73  virtual DtVector vector() const;
74  virtual void setVector(const DtVector& v);
76 
78  virtual void setAbsoluteLocation(const DtVector& worldLocation);
80  virtual void setObjectLocation(const DtUUID& object);
81 protected:
87 
89  friend const char* DtBufferSerialize::decode(DtRwLocationReference& val, const char *buffer);
90  friend char* DtBufferSerialize::encode(const DtRwLocationReference& val, char *buffer);
91 
92 };
UUID is a unique ID wrapper class.
Definition: uuid.h:59
virtual const char * readerWriterType() const
Used to supply a string type that this reader writer type is. This can be used in place of dynamic-ca...
DT_DLL_readerWriter int getSize(const DtString &val)
The number of bytes required to encode the value.
DtRwInt myLocationType
Enumerated location type represented by this location.
Definition: rwLocationReference.h:83
This class allows one to collect and compare strings using an index number instead of having to do st...
Definition: symbolString.h:27
Holds a position of some form. May be an absolute position, or a reference to another object...
Definition: rwLocationReference.h:25
Definition: readerWriter.h:85
DtRwVector myVector
Raw vector data. This is used as different types of data depending on the location type...
Definition: rwLocationReference.h:85
Definition: readerWriterRegistry.h:39
Contains the DtUUID class declaration.
LocationType
Definition: rwLocationReference.h:28
uuid class
Definition: rwUUID.h:26
Definition: rwVector.h:23
Description: Readable, Writable int.
Definition: rwInt.h:25
DT_DLL_readerWriter char * encode(const DtFilename &val, char *buffer)
Serializes the provided value val into buffer. buffer must have at least the number of bytes returned...
#define DT_DLL_vrfutil
This file is used to determine how to build Disable inconsistent dll linkage warning Visual Studio 6...
Definition: vrfutilDefines.h:34
DtRwUUID myObject
Definition: rwLocationReference.h:86
const DtReaderWriter & operator=(const DtReaderWriter &orig)
assignment operator
DT_DLL_readerWriter const char * decode(DtString &val, const char *buffer)
Decodes a value from buffer and places the result in val of the type specified by val...
File: rwVector.h.

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)