2025-01-04 04:12:51 +00:00
|
|
|
#include "qtworkspaceattribute.h"
|
|
|
|
|
|
|
|
|
|
#include "workspace/WorkSpace.h"
|
|
|
|
|
#include "workspace/Timestep.h"
|
|
|
|
|
#include "entities/Entity.h"
|
|
|
|
|
#include "entities/MeshComponent.h"
|
|
|
|
|
#include "entities/PathComponent.h"
|
|
|
|
|
#include "entities/ConeWaveComponent.h"
|
|
|
|
|
#include "entities/DashedLineComponent.h"
|
|
|
|
|
#include "entities/EntitiesManager.h"
|
|
|
|
|
#include "utils/Transform.h"
|
|
|
|
|
#include "utils/OsgUtils.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QWorkspaceAttribute::QWorkspaceAttribute(class WorkSpace* workspace)
|
|
|
|
|
: workspace_(workspace) {
|
2025-10-12 14:55:13 +00:00
|
|
|
if (workspace_) {
|
|
|
|
|
filesSeq_ = workspace_->GetFilesSeq();
|
|
|
|
|
}
|
2025-01-04 04:12:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool QWorkspaceAttribute::operator==(const QWorkspaceAttribute& other) {
|
2025-10-12 14:55:13 +00:00
|
|
|
return workspace_ == other.workspace_ && filesSeq_ == other.filesSeq_;
|
2025-01-04 04:12:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QWorkspaceAttribute& QWorkspaceAttribute::operator=(const QWorkspaceAttribute& other) {
|
|
|
|
|
workspace_ = other.workspace_;
|
2025-10-12 14:55:13 +00:00
|
|
|
filesSeq_ = other.filesSeq_;
|
2025-01-04 04:12:51 +00:00
|
|
|
return *this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QWorkspaceAttribute::SetName(const QString& name) {
|
|
|
|
|
if (nullptr == workspace_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
workspace_->SetName(name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const QString QWorkspaceAttribute::GetName() const {
|
|
|
|
|
if (nullptr == workspace_) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
return workspace_->GetName();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QWorkspaceAttribute::SetDescription(const QString& desc) {
|
|
|
|
|
if (nullptr == workspace_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
workspace_->SetDescribe(desc);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const QString QWorkspaceAttribute::GetDescription() const {
|
|
|
|
|
if (nullptr == workspace_) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
return workspace_->GetDescribe();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void QWorkspaceAttribute::SetTimeStep(const QString& timestep) {
|
|
|
|
|
if (nullptr == workspace_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-04 16:11:29 +00:00
|
|
|
Timestep* obj = workspace_->GetTimestep();
|
|
|
|
|
if (nullptr == obj) {
|
|
|
|
|
workspace_->SetTimestepPath(timestep);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const QString& path = obj->GetPath();
|
|
|
|
|
if (path == timestep) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-04 04:12:51 +00:00
|
|
|
workspace_->SetTimestepPath(timestep);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const QString QWorkspaceAttribute::GetTimeStep() const {
|
|
|
|
|
if (nullptr == workspace_) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Timestep* timestep = workspace_->GetTimestep();
|
|
|
|
|
if (nullptr == timestep) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
return timestep->GetPath();
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-07 15:45:23 +00:00
|
|
|
void QWorkspaceAttribute::SetSimMatlab(const QString& path) {
|
|
|
|
|
if (nullptr == workspace_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
workspace_->SetSimMatlab(path);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const QString QWorkspaceAttribute::GetSimMatlab() const {
|
|
|
|
|
if (nullptr == workspace_) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
return workspace_->GetSimMatlab();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QWorkspaceAttribute::SetMatlabParam(const QString& path)
|
|
|
|
|
{
|
|
|
|
|
if (nullptr == workspace_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
workspace_->SetMatlabParam(path);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const QString QWorkspaceAttribute::GetMatlabParam() const
|
|
|
|
|
{
|
|
|
|
|
if (nullptr == workspace_) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
return workspace_->GetMatlabParam();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QWorkspaceAttribute::SetWavePath(const QString& path)
|
|
|
|
|
{
|
|
|
|
|
if (nullptr == workspace_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
workspace_->SetWavePath(path);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const QString QWorkspaceAttribute::GetWavePath() const
|
|
|
|
|
{
|
|
|
|
|
if (nullptr == workspace_) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
return workspace_->GetWavePath();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QWorkspaceAttribute::SetReportPath(const QString& path)
|
|
|
|
|
{
|
|
|
|
|
if (nullptr == workspace_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
workspace_->SetReportPath(path);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const QString QWorkspaceAttribute::GetReportPath() const
|
|
|
|
|
{
|
|
|
|
|
if (nullptr == workspace_) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
return workspace_->GetReportPath();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QWorkspaceAttribute::SetRDPath(const QString& path)
|
|
|
|
|
{
|
|
|
|
|
if (nullptr == workspace_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
workspace_->SetRDPath(path);
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-12 14:14:16 +00:00
|
|
|
const QString QWorkspaceAttribute::GetRDPath() const
|
2025-01-07 15:45:23 +00:00
|
|
|
{
|
|
|
|
|
if (nullptr == workspace_) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
return workspace_->GetRDPath();
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-13 16:15:18 +00:00
|
|
|
void QWorkspaceAttribute::SetCommondFilePath(const QString& path)
|
|
|
|
|
{
|
|
|
|
|
if (nullptr == workspace_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
workspace_->SetCommondFilePath(path);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const QString QWorkspaceAttribute::GetCommondFilePath() const
|
|
|
|
|
{
|
|
|
|
|
if (nullptr == workspace_) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
2025-10-14 16:41:12 +00:00
|
|
|
|
|
|
|
|
QString path = QString("%1/%2").arg(workspace_->GetDir(), workspace_->GetCommondFilePath());
|
|
|
|
|
return path;
|
2025-10-13 16:15:18 +00:00
|
|
|
}
|
|
|
|
|
|
2025-10-12 14:14:16 +00:00
|
|
|
std::vector<FileEntry> QWorkspaceAttribute::GetFileEntries(FileEntryType type) const {
|
|
|
|
|
if (nullptr == workspace_) {
|
|
|
|
|
return {};
|
|
|
|
|
}
|
|
|
|
|
return workspace_->GetFileEntries(type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QWorkspaceAttribute::SetFileEntryCount(FileEntryType type, int count) {
|
|
|
|
|
if (nullptr == workspace_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
workspace_->SetFileEntryCount(type, count);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QWorkspaceAttribute::SetFileEntryPath(FileEntryType type, int index, const QString& path) {
|
|
|
|
|
if (nullptr == workspace_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
workspace_->SetFileEntryPath(type, index, path);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString QWorkspaceAttribute::GetFileEntryAbsPath(FileEntryType type, int index) const {
|
|
|
|
|
if (nullptr == workspace_) {
|
|
|
|
|
return QString();
|
|
|
|
|
}
|
|
|
|
|
return workspace_->GetFileEntryAbsPath(type, index);
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-04 04:12:51 +00:00
|
|
|
QTransformAttribute::QTransformAttribute(class Transform* obj)
|
|
|
|
|
: object_(obj) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool QTransformAttribute::operator!=(const QTransformAttribute& other) {
|
|
|
|
|
return object_ != other.object_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QTransformAttribute::SetLocation(const osg::Vec3& l) {
|
|
|
|
|
object_->SetLocation(l);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const osg::Vec3 QTransformAttribute::GetLocation() const {
|
|
|
|
|
if (nullptr == object_) {
|
|
|
|
|
return osg::Vec3(0.0f, 0.0f, 0.0f);
|
|
|
|
|
}
|
|
|
|
|
return object_->GetLocation();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QTransformAttribute::SetRotation(const osg::Vec3& r) {
|
|
|
|
|
object_->SetRotation(r);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const osg::Vec3 QTransformAttribute::GetRotation() const {
|
|
|
|
|
if (nullptr == object_) {
|
|
|
|
|
return osg::Vec3(0.0f, 0.0f, 0.0f);
|
|
|
|
|
}
|
|
|
|
|
return object_->GetRotation();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QTransformAttribute::SetScale(const osg::Vec3& s) {
|
|
|
|
|
object_->SetScale(s);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const osg::Vec3 QTransformAttribute::GetScale() const {
|
|
|
|
|
if (nullptr == object_) {
|
|
|
|
|
return osg::Vec3(1.0f, 1.0f, 1.0f);
|
|
|
|
|
}
|
|
|
|
|
return object_->GetScale();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool QTransformAttribute::operator==(const QTransformAttribute& other) {
|
|
|
|
|
return object_ == other.object_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QTransformAttribute& QTransformAttribute::operator=(const QTransformAttribute& other) {
|
|
|
|
|
if (this == &other) {
|
|
|
|
|
return *this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
object_ = other.object_;
|
|
|
|
|
return *this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QEntityAttribute::QEntityAttribute(class Entity* entity)
|
|
|
|
|
: entity_(entity) {
|
2025-06-27 16:23:58 +00:00
|
|
|
if (nullptr == entity) {
|
2025-01-04 04:12:51 +00:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
transform_ = (new QTransformAttribute(entity->GetTransform()));
|
2025-06-27 16:23:58 +00:00
|
|
|
visible_ = entity->IsVisible();
|
2025-01-04 04:12:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool QEntityAttribute::operator==(const QEntityAttribute& other) {
|
|
|
|
|
return entity_ == other.entity_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QEntityAttribute& QEntityAttribute::operator=(const QEntityAttribute& other) {
|
|
|
|
|
entity_ = other.entity_;
|
|
|
|
|
return *this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QEntityAttribute::SetName(const QString& name) {
|
|
|
|
|
if (nullptr == entity_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
entity_->SetName(name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const QString QEntityAttribute::GetName() const {
|
|
|
|
|
if (nullptr == entity_) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
return entity_->GetName();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QTransformAttribute QEntityAttribute::GetTransform() const {
|
|
|
|
|
if (nullptr == transform_) {
|
|
|
|
|
return QTransformAttribute();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return *transform_;
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-27 16:23:58 +00:00
|
|
|
void QEntityAttribute::SetVisible(bool v) {
|
|
|
|
|
visible_ = v;
|
|
|
|
|
if (nullptr == entity_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
entity_->SetVisible(v);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool QEntityAttribute::IsVisible() const {
|
|
|
|
|
return visible_;
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-04 04:12:51 +00:00
|
|
|
QMeshComponentAttribute::QMeshComponentAttribute(class MeshComponent* object)
|
|
|
|
|
: object_(object) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QMeshComponentAttribute::SetMesh(const QString& mesh) {
|
|
|
|
|
if (nullptr == object_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (mesh.toStdString() == object_->GetMesh()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
object_->LoadNode(mesh.toStdString().c_str());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString QMeshComponentAttribute::GetMesh() const {
|
|
|
|
|
if (nullptr == object_) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
return QString(object_->GetMesh().c_str());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool QMeshComponentAttribute::operator==(const QMeshComponentAttribute& other) {
|
|
|
|
|
return object_ == other.object_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QMeshComponentAttribute& QMeshComponentAttribute::operator=(const QMeshComponentAttribute& other) {
|
|
|
|
|
if (this == &other) {
|
|
|
|
|
return *this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
object_ = other.object_;
|
|
|
|
|
return *this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QPathComponentAttribute::QPathComponentAttribute(PathComponent* object)
|
|
|
|
|
: object_(object) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QPathComponentAttribute::SetPath(const QString& path) {
|
|
|
|
|
if (nullptr == object_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
object_->SetPath(path);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString QPathComponentAttribute::GetPath() const {
|
|
|
|
|
if (nullptr == object_) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
return object_->GetPath();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool QPathComponentAttribute::operator==(const QPathComponentAttribute& other) {
|
|
|
|
|
return object_ == other.object_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QPathComponentAttribute& QPathComponentAttribute::operator=(const QPathComponentAttribute& other) {
|
|
|
|
|
if (this == &other) {
|
|
|
|
|
return *this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
object_ = other.object_;
|
|
|
|
|
return *this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QConeWaveComponentAttribute::QConeWaveComponentAttribute(ConeWaveComponent* object)
|
|
|
|
|
: object_(object) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void QConeWaveComponentAttribute::SetRadius(float r) {
|
|
|
|
|
if (nullptr == object_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (r == object_->GetRadius()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
object_->SetRadius(r);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float QConeWaveComponentAttribute::GetRadius() const {
|
|
|
|
|
if (nullptr == object_) {
|
|
|
|
|
return 10.0f;
|
|
|
|
|
}
|
|
|
|
|
return object_->GetRadius();
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-25 16:13:22 +00:00
|
|
|
void QConeWaveComponentAttribute::SetBaseColor(const QColor& c) {
|
2025-01-04 04:12:51 +00:00
|
|
|
if (nullptr == object_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-25 16:13:22 +00:00
|
|
|
osg::Vec4 vColor = object_->GetBaseColor();
|
2025-01-04 04:12:51 +00:00
|
|
|
QColor color;
|
|
|
|
|
OsgUtils::Vec4ToQColor(vColor, &color);
|
|
|
|
|
if (c == color) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-25 16:13:22 +00:00
|
|
|
OsgUtils::QColorToVec4(c, &vColor);
|
|
|
|
|
object_->SetBaseColor(vColor);
|
2025-01-04 04:12:51 +00:00
|
|
|
}
|
|
|
|
|
|
2025-06-25 16:13:22 +00:00
|
|
|
QColor QConeWaveComponentAttribute::GetBaseColor() const {
|
2025-01-04 04:12:51 +00:00
|
|
|
if (nullptr == object_) {
|
|
|
|
|
return QColor();
|
|
|
|
|
}
|
2025-06-25 16:13:22 +00:00
|
|
|
osg::Vec4 vColor = object_->GetBaseColor();
|
2025-01-04 04:12:51 +00:00
|
|
|
QColor color;
|
|
|
|
|
OsgUtils::Vec4ToQColor(vColor, &color);
|
|
|
|
|
return color;
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-25 16:13:22 +00:00
|
|
|
void QConeWaveComponentAttribute::SetWaveColor(const QColor& c) {
|
2025-01-04 04:12:51 +00:00
|
|
|
if (nullptr == object_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-25 16:13:22 +00:00
|
|
|
osg::Vec4 vColor = object_->GetWaveColor();
|
2025-01-04 04:12:51 +00:00
|
|
|
QColor color;
|
|
|
|
|
OsgUtils::Vec4ToQColor(vColor, &color);
|
|
|
|
|
if (c == color) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-25 16:13:22 +00:00
|
|
|
OsgUtils::QColorToVec4(c, &vColor);
|
|
|
|
|
object_->SetWaveColor(vColor);
|
2025-01-04 04:12:51 +00:00
|
|
|
}
|
|
|
|
|
|
2025-06-25 16:13:22 +00:00
|
|
|
QColor QConeWaveComponentAttribute::GetWaveColor() const {
|
2025-01-04 04:12:51 +00:00
|
|
|
if (nullptr == object_) {
|
|
|
|
|
return QColor();
|
|
|
|
|
}
|
2025-06-25 16:13:22 +00:00
|
|
|
osg::Vec4 vColor = object_->GetWaveColor();
|
2025-01-04 04:12:51 +00:00
|
|
|
QColor color;
|
|
|
|
|
OsgUtils::Vec4ToQColor(vColor, &color);
|
|
|
|
|
return color;
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-25 16:13:22 +00:00
|
|
|
void QConeWaveComponentAttribute::SetRingBrightAlpha(float a) {
|
2025-01-04 04:12:51 +00:00
|
|
|
if (nullptr == object_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-25 16:13:22 +00:00
|
|
|
if (a == object_->GetRingBrightAlpha()) {
|
2025-01-04 04:12:51 +00:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-25 16:13:22 +00:00
|
|
|
object_->SetRingBrightAlpha(a);
|
2025-01-04 04:12:51 +00:00
|
|
|
}
|
|
|
|
|
|
2025-06-25 16:13:22 +00:00
|
|
|
float QConeWaveComponentAttribute::GetRingBrightAlpha() const {
|
2025-01-04 04:12:51 +00:00
|
|
|
if (nullptr == object_) {
|
2025-06-25 16:13:22 +00:00
|
|
|
return 0.5f;
|
2025-01-04 04:12:51 +00:00
|
|
|
}
|
2025-06-25 16:13:22 +00:00
|
|
|
return object_->GetRingBrightAlpha();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QConeWaveComponentAttribute::SetRingDarkAlpha(float a) {
|
|
|
|
|
if (nullptr == object_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
a = std::max(a, 0.0f);
|
|
|
|
|
a = std::min(a, 1.0f);
|
|
|
|
|
|
|
|
|
|
object_->SetRingDarkAlpha(a);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float QConeWaveComponentAttribute::GetRingDarkAlpha() const {
|
|
|
|
|
if (nullptr == object_) {
|
|
|
|
|
return 0.5f;
|
|
|
|
|
}
|
|
|
|
|
return object_->GetRingDarkAlpha();
|
2025-01-04 04:12:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QConeWaveComponentAttribute::SetHeight(float h) {
|
|
|
|
|
if (nullptr == object_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (h == object_->GetHeight()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
object_->SetHeight(h);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float QConeWaveComponentAttribute::GetHeight() const {
|
|
|
|
|
if (nullptr == object_) {
|
|
|
|
|
return 60.0f;
|
|
|
|
|
}
|
|
|
|
|
return object_->GetHeight();
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-25 16:13:22 +00:00
|
|
|
void QConeWaveComponentAttribute::SetWaveCount(int c) {
|
2025-01-04 04:12:51 +00:00
|
|
|
if (nullptr == object_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-25 16:13:22 +00:00
|
|
|
if (c == object_->GetWaveCount()) {
|
2025-01-04 04:12:51 +00:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-25 16:13:22 +00:00
|
|
|
object_->SetWaveCount(c);
|
2025-01-04 04:12:51 +00:00
|
|
|
}
|
|
|
|
|
|
2025-06-25 16:13:22 +00:00
|
|
|
int QConeWaveComponentAttribute::GetWaveCount() const {
|
2025-01-04 04:12:51 +00:00
|
|
|
if (nullptr == object_) {
|
|
|
|
|
return 4;
|
|
|
|
|
}
|
2025-06-25 16:13:22 +00:00
|
|
|
return object_->GetWaveCount();
|
2025-01-04 04:12:51 +00:00
|
|
|
}
|
|
|
|
|
|
2025-06-25 16:13:22 +00:00
|
|
|
void QConeWaveComponentAttribute::SetWaveSpeed(float h) {
|
2025-01-04 04:12:51 +00:00
|
|
|
if (nullptr == object_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-25 16:13:22 +00:00
|
|
|
if (h == object_->GetWaveSpeed()) {
|
2025-01-04 04:12:51 +00:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-25 16:13:22 +00:00
|
|
|
object_->SetWaveSpeed(h);
|
2025-01-04 04:12:51 +00:00
|
|
|
}
|
|
|
|
|
|
2025-06-25 16:13:22 +00:00
|
|
|
float QConeWaveComponentAttribute::GetWaveSpeed() const {
|
2025-01-04 04:12:51 +00:00
|
|
|
if (nullptr == object_) {
|
|
|
|
|
return 500.0f;
|
|
|
|
|
}
|
2025-06-25 16:13:22 +00:00
|
|
|
return object_->GetWaveSpeed();
|
2025-01-04 04:12:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool QConeWaveComponentAttribute::operator==(const QConeWaveComponentAttribute& other) {
|
|
|
|
|
return object_ == other.object_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QConeWaveComponentAttribute& QConeWaveComponentAttribute::operator=(const QConeWaveComponentAttribute& other) {
|
|
|
|
|
if (this == &other) {
|
|
|
|
|
return *this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
object_ = other.object_;
|
|
|
|
|
return *this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QDashedLineComponentAttribute::QDashedLineComponentAttribute(class DashedLineComponent* obj)
|
|
|
|
|
: object_(obj) {
|
|
|
|
|
if (nullptr == obj) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
startEntity_ = QEntityAttribute(obj->GetStartEntityPtr());
|
|
|
|
|
endEntity_ = QEntityAttribute(obj->GetEndEntityPtr());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QDashedLineComponentAttribute::SetStart(const QString& uuid) {
|
|
|
|
|
if (nullptr == object_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
startUUid_ = object_->GetStartEntity();
|
|
|
|
|
startName_ = object_->GetStartEntityName();
|
|
|
|
|
|
|
|
|
|
if (uuid == startName_ || uuid == startUUid_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
std::string suuid = uuid.toStdString();
|
|
|
|
|
std::string suuid_ = startName_.toStdString();
|
|
|
|
|
std::string suuid2 = startUUid_.toStdString();
|
|
|
|
|
|
|
|
|
|
object_->SetStartEntity(uuid);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QDashedLineComponentAttribute::SetStart(const QEntityAttribute& start) {
|
|
|
|
|
startEntity_ = start;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const QEntityAttribute& QDashedLineComponentAttribute::GetStart() const {
|
|
|
|
|
return startEntity_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//QString QDashedLineComponentAttribute::GetStart() const {
|
|
|
|
|
// if (nullptr == object_) {
|
|
|
|
|
// return "";
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// startUUid_ = object_->GetStartEntity();
|
|
|
|
|
// startName_ = object_->GetStartEntityName();
|
|
|
|
|
// return startName_;
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
void QDashedLineComponentAttribute::SetEnd(const QString& uuid) {
|
|
|
|
|
if (nullptr == object_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
endUUid_ = object_->GetEndEntity();
|
|
|
|
|
endName_ = object_->GetEndEntityName();
|
|
|
|
|
if (uuid == endUUid_ || uuid == endName_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
object_->SetEndEntity(uuid);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QDashedLineComponentAttribute::SetEnd(const QEntityAttribute& end) {
|
|
|
|
|
endEntity_ = end;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//QString QDashedLineComponentAttribute::GetEnd() const {
|
|
|
|
|
// if (nullptr == object_) {
|
|
|
|
|
// return "";
|
|
|
|
|
// }
|
|
|
|
|
// endUUid_ = object_->GetEndEntity();
|
|
|
|
|
// endName_ = object_->GetEndEntityName();
|
|
|
|
|
// return endName_;
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
void QDashedLineComponentAttribute::SetRadius(float r) {
|
|
|
|
|
if (nullptr == object_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (r == object_->GetRadius()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
object_->SetRadius(r);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float QDashedLineComponentAttribute::GetRadius() const {
|
|
|
|
|
if (nullptr == object_) {
|
|
|
|
|
return 2.0f;
|
|
|
|
|
}
|
|
|
|
|
return object_->GetRadius();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void QDashedLineComponentAttribute::SetColor(const QColor& c) {
|
|
|
|
|
if (nullptr == object_) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
osg::Vec4 vColor = object_->GetBaseColor();
|
|
|
|
|
QColor color;
|
|
|
|
|
OsgUtils::Vec4ToQColor(vColor, &color);
|
|
|
|
|
if (c == color) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
OsgUtils::QColorToVec4(color, &vColor);
|
|
|
|
|
object_->SetBaseColor(vColor);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QColor QDashedLineComponentAttribute::GetColor() const {
|
|
|
|
|
if (nullptr == object_) {
|
|
|
|
|
return QColor();
|
|
|
|
|
}
|
|
|
|
|
osg::Vec4 vColor = object_->GetBaseColor();
|
|
|
|
|
QColor color;
|
|
|
|
|
OsgUtils::Vec4ToQColor(vColor, &color);
|
|
|
|
|
return color;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool QDashedLineComponentAttribute::operator==(const QDashedLineComponentAttribute& other) {
|
|
|
|
|
return object_ == other.object_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QDashedLineComponentAttribute& QDashedLineComponentAttribute::operator=(const QDashedLineComponentAttribute& other) {
|
|
|
|
|
if (this == &other) {
|
|
|
|
|
return *this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
object_ = other.object_;
|
|
|
|
|
return *this;
|
|
|
|
|
}
|