AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
DotGraphWriter.h
Go to the documentation of this file.
1/*
2Copyright 2007-2024. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or
9having been advised so by Algoryx Simulation AB for a time limited evaluation,
10or having purchased a valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#pragma once
18
19#include <agx/Referenced.h>
20#include <agx/HashTable.h>
22
23namespace agxPowerLine
24{
25 class PowerLine;
26
28
29
31 {
32 public:
33 DotGraphWriter(const char* rotRateUnit = "rad/s", const char* transRateUnit = "m/s");
34
35 void registerUnit(const char* dimensionName, const char* unitName);
36
37 bool writeDimensionsGraph(const agx::String& filename, const PowerLine* powerline);
38 bool writeDimensionsGraph(const agx::String& filename, const agxPowerLine::Unit* startUnit);
40
41 //bool writeUnitGraph(const char* filename, agxPowerLine::PowerLine* powerline);
42
43 protected:
44 virtual ~DotGraphWriter() {}
45
46 private:
47 void clear();
48 bool writeDimensionsGraph(const agx::String& filename);
49 void visitDimensionConnections( const agxPowerLine::ConnectionRefVector& connections );
50 void visitConnectorDimensions( const agxPowerLine::ConnectionRefVector& connections );
51
52 private:
54 UnitsTable m_units;
55
56 typedef agx::Vector<const PhysicalDimension*> DimensionVector;
57 typedef agx::Vector<const Connector*> ConnectorVector;
58
59 // The index of each dimension and connector in these vectors determines it's
60 // id within the DOT graph. Each dimension and connector may only be represented
61 // once.
62 DimensionVector m_seenDimensions;
63 ConnectorVector m_seenConnectors;
64
67
68 // The index of each dimension and connector is kept in these hash tables.
69 DimensionToIndexTable m_dimensionToIndexTable;
70 ConnectorToIndexTable m_connectorToIndexTable;
71
72 typedef agx::Vector<const Unit*> UnitVector;
73
74 UnitVector m_queue;
75 };
76}
#define AGX_DECLARE_POINTER_TYPES(type)
Definition Referenced.h:254
#define AGXMODEL_EXPORT
bool writeDimensionsGraph(const agx::String &filename, const PowerLine *powerline)
bool writeDimensionsGraph(const agx::String &filename, const agxPowerLine::Unit *startUnit)
DotGraphWriter(const char *rotRateUnit="rad/s", const char *transRateUnit="m/s")
void registerUnit(const char *dimensionName, const char *unitName)
bool writeDimensionsGraph(const agx::String &filename, const UnitPtrPowerLinePtrHashVector &roots)
PowerLine is the base class for a system of power transfer integrated into the rigid body simulation.
Definition PowerLine.h:66
Pure virtual class.
Definition Unit.h:72
This class is a combined container which has the find complexity of a HashTable, deterministic iterat...
Definition HashVector.h:41
Inheritance with partial specialization due to bug with ref_ptr containers.
Base class providing referencing counted objects.
Definition Referenced.h:120
agxPowerLine contains a collection of connected components that transport power across a system.
Definition MotorUnit.h:24