File size: 3,636 Bytes
a5ffdcd | 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 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | /*******************************************************************************
*
This file is part of the LibreCAD project, a 2D CAD program
Copyright (C) 2024 LibreCAD.org
Copyright (C) 2024 sand1024
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
******************************************************************************/
#include "lc_view.h"
LC_View::LC_View() {}
LC_View::LC_View(const QString &name):m_name(name) {}
LC_View* LC_View::clone() {
auto* clone = new LC_View(m_name);
clone->m_cameraPlottable = m_cameraPlottable;
clone->m_flags = m_flags;
clone->m_viewMode = m_viewMode;
clone->m_lensLen = m_lensLen;
clone->m_twistAngle = m_twistAngle;
clone->m_backClippingPlaneOffset = m_backClippingPlaneOffset;
clone->m_frontClippingPlaneOffset = m_frontClippingPlaneOffset;
clone->m_renderMode = m_renderMode;
clone->m_center = m_center;
clone->m_size = m_size;
clone->m_targetPoint = m_targetPoint;
clone->m_viewDirection = m_viewDirection;
clone->m_ucs = m_ucs;
return clone;
}
void LC_View::setName(const QString &n) {
m_name = n;
}
RS_Vector LC_View::getSize() const {
return m_size;
}
void LC_View::setSize(RS_Vector s) {
m_size = s;
}
void LC_View::setCenter(RS_Vector s) {
m_center = s;
}
RS_Vector LC_View::getCenter() const {
return m_center;
}
void LC_View::setTargetPoint(RS_Vector p) {
m_targetPoint = p;
}
RS_Vector LC_View::getTargetPoint() const{
return m_targetPoint;
}
void LC_View::setCameraPlottable(bool b) {
m_cameraPlottable = b;
}
bool LC_View::isCameraPlottable() const{
return m_cameraPlottable;
}
void LC_View::setLensLen(double d){
m_lensLen = d;
}
double LC_View::getLensLen() const {
return m_lensLen;
}
void LC_View::setViewDirection(RS_Vector dir) {
m_viewDirection = dir;
}
const RS_Vector LC_View::getViewDirection() const {
return m_viewDirection;
}
void LC_View::setFrontClippingPlaneOffset(double d) {
m_frontClippingPlaneOffset = d;
}
double LC_View::getFrontClippingPlaneOffset() const {
return m_frontClippingPlaneOffset;
}
void LC_View::setBackClippingPlaneOffset(double d) {
m_backClippingPlaneOffset = d;
}
double LC_View::getBackClippingPlaneOffset() const {
return m_backClippingPlaneOffset;
}
bool LC_View::isHasUCS() const {
return m_ucs != nullptr;
}
void LC_View::setViewMode(int i) {
m_viewMode = i;
}
int LC_View::getViewMode() const {
return m_viewMode;
}
void LC_View::setFlags(int i) {
m_flags = i;
}
int LC_View::getFlags() const {
return m_flags;
}
void LC_View::setTwistAngle(double d) {
m_twistAngle = d;
}
double LC_View::getTwistAngle() const{
return m_twistAngle;
}
void LC_View::setUCS(LC_UCS *pUcs) {
m_ucs = pUcs;
}
LC_UCS *LC_View::getUCS() const{
return m_ucs;
}
bool LC_View::isValidName([[maybe_unused]]QString &nameCandidate) {
// fixme - implement Named View name validation rules there
return true;
}
|