-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPyEffectivePrestressGraphViewController.cpp
119 lines (98 loc) · 3.74 KB
/
PyEffectivePrestressGraphViewController.cpp
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#include "stdafx.h"
#include "PyEffectivePrestressGraphViewController.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
void CPyEffectivePrestressGraphViewController::Init(IEffectivePrestressGraphViewController* pViewController)
{
m_pMyViewController = pViewController;
CPyViewControllerBase::Init(pViewController);
}
IntervalIndexType CPyEffectivePrestressGraphViewController::GetMinimumInterval() const
{
IntervalIndexType minIntervalIdx, maxIntervalIdx;
m_pMyViewController->GetIntervalRange(&minIntervalIdx, &maxIntervalIdx);
return minIntervalIdx;
}
IntervalIndexType CPyEffectivePrestressGraphViewController::GetMaximumInterval() const
{
IntervalIndexType minIntervalIdx, maxIntervalIdx;
m_pMyViewController->GetIntervalRange(&minIntervalIdx, &maxIntervalIdx);
return maxIntervalIdx;
}
void CPyEffectivePrestressGraphViewController::SelectInterval(IntervalIndexType intervalIdx)
{
m_pMyViewController->SelectInterval(intervalIdx);
}
void CPyEffectivePrestressGraphViewController::SelectIntervals(const boost::python::list& listIntervals)
{
boost::python::stl_input_iterator<IntervalIndexType> begin(listIntervals), end;
std::vector<IntervalIndexType> vIntervals(begin, end);
m_pMyViewController->SelectIntervals(vIntervals);
}
boost::python::list CPyEffectivePrestressGraphViewController::GetSelectedIntervals() const
{
std::vector<IntervalIndexType> vIntervals = m_pMyViewController->GetSelectedIntervals();
boost::python::list list;
std::for_each(vIntervals.cbegin(), vIntervals.cend(), [&list](const auto& intervalIdx) {list.append(intervalIdx);});
return list;
}
const CGirderKey& CPyEffectivePrestressGraphViewController::GetGirder() const
{
return m_pMyViewController->GetGirder();
}
void CPyEffectivePrestressGraphViewController::SelectGirder(const CGirderKey& girderKey)
{
m_pMyViewController->SelectGirder(girderKey);
}
void CPyEffectivePrestressGraphViewController::SetViewMode(IEffectivePrestressGraphViewController::ViewMode mode)
{
m_pMyViewController->SetViewMode(mode);
}
IEffectivePrestressGraphViewController::ViewMode CPyEffectivePrestressGraphViewController::GetViewMode() const
{
return m_pMyViewController->GetViewMode();
}
void CPyEffectivePrestressGraphViewController::SetStrandType(IEffectivePrestressGraphViewController::StrandType strandType)
{
m_pMyViewController->SetStrandType(strandType);
}
IEffectivePrestressGraphViewController::StrandType CPyEffectivePrestressGraphViewController::GetStrandType() const
{
return m_pMyViewController->GetStrandType();
}
void CPyEffectivePrestressGraphViewController::SetDuct(IEffectivePrestressGraphViewController::DuctType ductType, DuctIndexType ductIdx)
{
m_pMyViewController->SetDuct(ductType,ductIdx);
}
DuctIndexType CPyEffectivePrestressGraphViewController::GetDuct() const
{
return m_pMyViewController->GetDuct();
}
IEffectivePrestressGraphViewController::DuctType CPyEffectivePrestressGraphViewController::GetDuctType() const
{
return m_pMyViewController->GetDuctType();
}
void CPyEffectivePrestressGraphViewController::SetShowGrid(bool bShow)
{
m_pMyViewController->ShowGrid(bShow);
}
bool CPyEffectivePrestressGraphViewController::GetShowGrid() const
{
return m_pMyViewController->ShowGrid();
}
void CPyEffectivePrestressGraphViewController::SetShowGirder(bool bShow)
{
m_pMyViewController->ShowGirder(bShow);
}
bool CPyEffectivePrestressGraphViewController::GetShowGirder() const
{
return m_pMyViewController->ShowGirder();
}
CPyEffectivePrestressGraphViewController* CPyEffectivePrestressGraphViewController::GetGraphController(CPyViewControllerBase* pController)
{
auto pMyController = static_cast<CPyEffectivePrestressGraphViewController*>(pController);
return pMyController;
}