VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
extendedAttributeDecoderHLA.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2017 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 #ifdef DtHLA
10 
11 #include <vlutil/vlString.h>
12 #include <vl/fom.h>
13 #include <vl/objClassDesc.h>
14 #include <vl/hlaStateDecoder.h>
15 
16 namespace makVrfVrlinkExtToolkit
17 {
18  template <typename StateRepType>
20  {
21  public:
22 
26  static void decodeExtendedAttribute(StateRepType& rep,
27  const RTI::AttributeHandleValuePairSet& attrs, unsigned long pairSetIndex)
28  {
29  StateRepType* extSR = static_cast<StateRepType*>(&rep);
30 
31  // Keep a static buffer so that we're not constantly
32  // deallocating/reallocating memory.
33  std::vector<char> buffer;
34  char* bufPtr = 0;
35 
36  RTI::ULong length = attrs.getValueLength(pairSetIndex);
37  if (length > 0)
38  {
39  buffer.resize(length);
40  bufPtr = &buffer[0];
41  attrs.getValue(pairSetIndex, bufPtr, length);
42  extSR->setAttributeByHandle(attrs.getHandle(pairSetIndex), bufPtr, length);
43  }
44  }
45  };
46 }
47 
48 
49 #endif
DT_DLL_VRVCORE double length(const makVrv::DtCoordinateSystem &, const std::vector< DtVector > &vertices)
Returns the total distance of a segmented line defined by the provided vector of vertices. Coordinates are in local database coordinates. The coordinate system is used to convert between the local database coordinates and geocentric. All distance is in 2D – the Z value is ignored.

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)