forked from eu07/maszyna
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTraction.h
87 lines (79 loc) · 3.14 KB
/
Traction.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*
This Source Code Form is subject to the
terms of the Mozilla Public License, v.
2.0. If a copy of the MPL was not
distributed with this file, You can
obtain one at
http://mozilla.org/MPL/2.0/.
*/
#ifndef TractionH
#define TractionH
#include "opengl/glew.h"
#include "dumb3d.h"
#include "VBO.h"
using namespace Math3D;
class TTractionPowerSource;
class TTraction
{ // drut zasilaj¹cy, dla wskaŸników u¿ywaæ przedrostka "hv"
private:
// vector3 vUp,vFront,vLeft;
// matrix4x4 mMatrix;
// matryca do wyliczania pozycji drutu w zale¿noœci od [X,Y,k¹t] w scenerii:
// - x: odleg³oœæ w bok (czy odbierak siê nie zsun¹³)
// - y: przyjmuje wartoœæ <0,1>, jeœli pod drutem (wzd³u¿)
// - z: wysokoœæ bezwzglêdna drutu w danym miejsu
public: // na razie
TTractionPowerSource *psPower[2]; // najbli¿sze zasilacze z obu kierunków
TTractionPowerSource *psPowered; // ustawione tylko dla bezpoœrednio zasilanego przês³a
TTraction *hvNext[2]; //³¹czenie drutów w sieæ
int iNext[2]; // do którego koñca siê ³¹czy
int iLast; // ustawiony bit 0, jeœli jest ostatnim drutem w sekcji; bit1 - przedostatni
public:
GLuint uiDisplayList;
vector3 pPoint1, pPoint2, pPoint3, pPoint4;
vector3 vParametric; // wspó³czynniki równania parametrycznego odcinka
double fHeightDifference; //,fMiddleHeight;
// int iCategory,iMaterial,iDamageFlag;
// float fU,fR,fMaxI,fWireThickness;
int iNumSections;
int iLines; // ilosc linii dla VBO
float NominalVoltage;
float MaxCurrent;
float fResistivity; //[om/m], przeliczone z [om/km]
DWORD Material; // 1: Cu, 2: Al
float WireThickness;
DWORD DamageFlag; // 1: zasniedziale, 128: zerwana
int Wires;
float WireOffset;
AnsiString asPowerSupplyName; // McZapkie: nazwa podstacji trakcyjnej
TTractionPowerSource *
psSection; // zasilacz (opcjonalnie mo¿e to byæ pulpit steruj¹cy EL2 w hali!)
AnsiString asParallel; // nazwa przês³a, z którym mo¿e byæ bie¿nia wspólna
TTraction *hvParallel; // jednokierunkowa i zapêtlona lista przêse³ ewentualnej bie¿ni wspólnej
float fResistance[2]; // rezystancja zastêpcza do punktu zasilania (0: przês³o zasilane, <0: do
// policzenia)
int iTries;
// bool bVisible;
// DWORD dwFlags;
void Optimize();
TTraction();
~TTraction();
// virtual void InitCenter(vector3 Angles, vector3 pOrigin);
// virtual bool Hit(double x, double z, vector3 &hitPoint, vector3 &hitDirection)
// { return TNode::Hit(x,z,hitPoint,hitDirection); };
// virtual bool Move(double dx, double dy, double dz) { return false; };
// virtual void SelectedRender();
void RenderDL(float mgn);
int RaArrayPrepare();
void RaArrayFill(CVertNormTex *Vert);
void RenderVBO(float mgn, int iPtr);
int TestPoint(vector3 *Point);
void Connect(int my, TTraction *with, int to);
void Init();
bool WhereIs();
void ResistanceCalc(int d = -1, double r = 0, TTractionPowerSource *ps = NULL);
void PowerSet(TTractionPowerSource *ps);
double VoltageGet(double u, double i);
};
//---------------------------------------------------------------------------
#endif