Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F94231381
systempanel.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Dec 4, 23:19
Size
1 KB
Mime Type
text/x-c
Expires
Fri, Dec 6, 23:19 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22765193
Attached To
rSYMKIT symkit
systempanel.cpp
View Options
#include "systempanel.h"
//#include <QStackedLayout>
#include <QVBoxLayout>
#include <QTabWidget>
#include "actors/symsystem.h"
#include "skactor.h"
#include "actors/symsystem.h"
using
namespace
std
;
/* SystemOffsetEdit section */
SystemOffsetEdit
::
SystemOffsetEdit
(
SymSystem
*
system
,
SystemPanel
*
parent
)
:
VectorEdit
(
"Offset"
,
parent
),
system
(
system
)
{
adaptComponents
();
}
void
SystemOffsetEdit
::
uploadComponent
(
std
::
size_t
index
)
{
SVector
<
3
>
load
=
system
->
getOffset
();
load
[
index
]
=
getContent
(
index
);
system
->
setOffset
(
load
);
}
void
SystemOffsetEdit
::
updateComponent
(
std
::
size_t
index
)
{
setContent
(
index
,
system
->
getOffset
()[
index
]);
}
void
SystemOffsetEdit
::
adaptComponents
()
{
for
(
int
i
=
0
;
i
<
3
;
++
i
)
pushComponent
(
system
->
getOffset
()[
i
]);
}
/* SystemPanel section */
SystemPanel
::
SystemPanel
(
SymSystem
*
system
,
QWidget
*
parent
)
:
ActorPanel
(
system
,
parent
)
{
mainLayout
=
new
QVBoxLayout
();
offsetEdit
=
new
SystemOffsetEdit
(
system
,
this
);
mainLayout
->
addWidget
(
offsetEdit
);
actorScreen
=
new
QTabWidget
(
this
);
mainLayout
->
addWidget
(
actorScreen
);
// set 10% spacing
mainLayout
->
setStretch
(
0
,
1
);
// set 90% spacing
mainLayout
->
setStretch
(
1
,
9
);
setSystem
(
system
);
setLayout
(
mainLayout
);
}
SystemPanel
::~
SystemPanel
()
{
delete
mainLayout
;
delete
actorScreen
;
delete
offsetEdit
;
}
void
SystemPanel
::
setSystem
(
SymSystem
*
system
)
{
actorScreen
->
clear
();
nestedPanels
.
clear
();
for
(
auto
actor
:
*
system
)
{
ActorPanel
*
panel
=
new
ActorPanel
(
actor
,
actorScreen
);
nestedPanels
.
push_back
(
unique_ptr
<
ActorPanel
>
(
panel
));
actorScreen
->
addTab
(
panel
,
actor
->
getLabel
());
}
this
->
system
=
system
;
}
SymSystem
*
SystemPanel
::
getSystem
()
{
return
system
;
}
const
SymSystem
*
SystemPanel
::
getSystem
()
const
{
return
system
;
}
Event Timeline
Log In to Comment