238 p1->
x1 += (p1->
x1 - p2->
x1) * f;
239 p1->
x2 += (p1->
x2 - p2->
x2) * f;
243 p2->
x1 += (p2->
x1 - p1->
x1) * f;
244 p2->
x2 += (p2->
x2 - p1->
x2) * f;
258 p1->
x1 += (p1->
x1 - p2->
x1) * f;
259 p1->
x3 += (p1->
x3 - p2->
x3) * f;
263 p2->
x1 += (p2->
x1 - p1->
x1) * f;
264 p2->
x3 += (p2->
x3 - p1->
x3) * f;
278 p1->
x2 += (p1->
x2 - p2->
x2) * f;
279 p1->
x3 += (p1->
x3 - p2->
x3) * f;
283 p2->
x2 += (p2->
x2 - p1->
x2) * f;
284 p2->
x3 += (p2->
x3 - p1->
x3) * f;
298 p1->
x1 += (p1->
x1 - p2->
x1) * f;
299 p1->
x2 += (p1->
x2 - p2->
x2) * f;
303 p2->
x1 += (p2->
x1 - p1->
x1) * f;
304 p2->
x2 += (p2->
x2 - p1->
x2) * f;
318 p1->
x1 += (p1->
x1 - p2->
x1) * f;
319 p1->
x3 += (p1->
x3 - p2->
x3) * f;
323 p2->
x1 += (p2->
x1 - p1->
x1) * f;
324 p2->
x3 += (p2->
x3 - p1->
x3) * f;
338 p1->
x2 += (p1->
x2 - p2->
x2) * f;
339 p1->
x3 += (p1->
x3 - p2->
x3) * f;
343 p2->
x2 += (p2->
x2 - p1->
x2) * f;
344 p2->
x3 += (p2->
x3 - p1->
x3) * f;
692 PointSet3 ps(points);
694 int n = (
int)points.size();
728 for (
i = 1;
i <
n;
i++) {
731 f = (
x13 - (points)[
i].x3) / ((points)[
i].x3 - last.
x3);
732 ps.add(
GbPoint3D((points)[
i].x1 + ((points)[
i].x1 - last.
x1) * f,
733 (points)[
i].x2 + ((points)[
i].x2 - last.
x2) * f,
x13));
738 f = (
x13 - (points)[
i].x3) / ((points)[
i].x3 - last.
x3);
739 ps.add(
GbPoint3D((points)[
i].x1 + ((points)[
i].x1 - last.
x1) * f,
740 (points)[
i].x2 + ((points)[
i].x2 - last.
x2) * f,
x13));
748 f = (
x13 - (points)[0].x3) / ((points)[0].x3 - last.
x3);
749 ps.add(
GbPoint3D((points)[0].x1 + ((points)[0].x1 - last.
x1) * f,
750 (points)[0].x2 + ((points)[0].x2 - last.
x2) * f,
x13));
753 points = ps.getPoints();
754 n = (
int)points.size();
772 for (
i = 1;
i <
n;
i++) {
775 f = (
x12 - (points)[
i].x2) / ((points)[
i].x2 - last.
x2);
777 (points)[
i].x3 + ((points)[
i].x3 - last.
x3) * f));
782 f = (
x12 - (points)[
i].x2) / ((points)[
i].x2 - last.
x2);
784 (points)[
i].x3 + ((points)[
i].x3 - last.
x3) * f));
792 f = (
x12 - (points)[0].x2) / ((points)[0].x2 - last.
x2);
793 ps.add(
GbPoint3D((points)[0].x1 + ((points)[0].x1 - last.
x1) * f,
x12,
794 (points)[0].x3 + ((points)[0].x3 - last.
x3) * f));
797 points = ps.getPoints();
798 n = (
int)points.size();
816 for (
i = 1;
i <
n;
i++) {
819 f = (
x21 - (points)[
i].x1) / ((points)[
i].x1 - last.
x1);
821 (points)[
i].x3 + ((points)[
i].x3 - last.
x3) * f));
826 f = (
x21 - (points)[
i].x1) / ((points)[
i].x1 - last.
x1);
828 (points)[
i].x3 + ((points)[
i].x3 - last.
x3) * f));
836 f = (
x21 - (points)[0].x1) / ((points)[0].x1 - last.
x1);
837 ps.add(
GbPoint3D(
x21, (points)[0].x2 + ((points)[0].x2 - last.
x2) * f,
838 (points)[0].x3 + ((points)[0].x3 - last.
x3) * f));
841 points = ps.getPoints();
842 n = (
int)points.size();
859 for (
i = 1;
i <
n;
i++) {
862 f = (
x23 - (points)[
i].x3) / ((points)[
i].x3 - last.
x3);
863 ps.add(
GbPoint3D((points)[
i].x1 + ((points)[
i].x1 - last.
x1) * f,
864 (points)[
i].x2 + ((points)[
i].x2 - last.
x2) * f,
x23));
869 f = (
x23 - (points)[
i].x3) / ((points)[
i].x3 - last.
x3);
870 ps.add(
GbPoint3D((points)[
i].x1 + ((points)[
i].x1 - last.
x1) * f,
871 (points)[
i].x2 + ((points)[
i].x2 - last.
x2) * f,
x23));
879 f = (
x23 - (points)[0].x3) / ((points)[0].x3 - last.
x3);
880 ps.add(
GbPoint3D((points)[0].x1 + ((points)[0].x1 - last.
x1) * f,
881 (points)[0].x2 + ((points)[0].x2 - last.
x2) * f,
x23));
884 points = ps.getPoints();
885 n = (
int)points.size();
903 for (
i = 1;
i <
n;
i++) {
906 f = (
x22 - (points)[
i].x2) / ((points)[
i].x2 - last.
x2);
908 (points)[
i].x3 + ((points)[
i].x3 - last.
x3) * f));
913 f = (
x22 - (points)[
i].x2) / ((points)[
i].x2 - last.
x2);
915 (points)[
i].x3 + ((points)[
i].x3 - last.
x3) * f));
923 f = (
x22 - (points)[0].x2) / ((points)[0].x2 - last.
x2);
924 ps.add(
GbPoint3D((points)[0].x1 + ((points)[0].x1 - last.
x1) * f,
x22,
925 (points)[0].x3 + ((points)[0].x3 - last.
x3) * f));
928 points = ps.getPoints();
929 n = (
int)points.size();
946 for (
i = 1;
i <
n;
i++) {
949 f = (
x11 - (points)[
i].x1) / ((points)[
i].x1 - last.
x1);
951 (points)[
i].x3 + ((points)[
i].x3 - last.
x3) * f));
956 f = (
x11 - (points)[
i].x1) / ((points)[
i].x1 - last.
x1);
958 (points)[
i].x3 + ((points)[
i].x3 - last.
x3) * f));
966 f = (
x11 - (points)[0].x1) / ((points)[0].x1 - last.
x1);
967 ps.add(
GbPoint3D(
x11, (points)[0].x2 + ((points)[0].x2 - last.
x2) * f,
968 (points)[0].x3 + ((points)[0].x3 - last.
x3) * f));
971 points = ps.getPoints();
972 n = (
int)points.size();
1042 this->points.reserve(
n);
1054 if (!this->points.empty() &&
point.equals(&
this->points.back()))
1058 this->points.push_back(
point);
1060 this->consistent =
false;
1065 if (this->containsEqual(
point) > 0)
1068 this->points.push_back(
point);
1069 this->consistent =
false;
1077 this->consistent =
false;
1087 for (
int i = 1;
i <= index;
i++)
1093 this->consistent =
false;
1112 this->points.clear();
1113 this->consistent =
false;
1119 this->points.resize(0);
1120 this->consistent =
false;
1125 if (!this->consistent)
1126 this->calculateValues();
1132 if (!this->consistent)
1133 this->calculateValues();
1139 if (!this->consistent)
1140 this->calculateValues();
1146 if (!this->consistent)
1147 this->calculateValues();
1153 if (!this->consistent)
1154 this->calculateValues();
1160 if (!this->consistent)
1161 this->calculateValues();
1170 for (
int pos = (
int)this->points.size() - 1;
pos >= 0;
pos--)
1182 for (
int pos = (
int)this->points.size() - 1;
pos >= 0;
pos--)
1183 if (this->points[
pos].equals(&
point))
1216 if ((*pos1).equals(&
point1) && (*pos2).equals(&
point2))
1218 else if ((*pos1).equals(&
point2) && (*pos2).equals(&
point1))
1231 return &(this->points)[index];
1244 return this->points;
1257 if (this->points.empty()) {
1258 this->x1min = this->x2min = this->x3min = 0.0;
1259 this->x1max = this->x2max = this->x3max = 0.0;
1261 this->x1min = (this->points)[0].x1;
1262 this->x1max = (this->points)[0].x1;
1263 this->x2min = (this->points)[0].x2;
1264 this->x2max = (this->points)[0].x2;
1265 this->x3min = (this->points)[0].x3;
1266 this->x3max = (this->points)[0].x3;
1268 for (
int i = (
int)this->points.size() - 1;
i > 0; --
i) {
1269 if ((this->points)[
i].x1 < this->x1min)
1270 this->x1min = (this->points)[
i].
x1;
1271 if ((this->points)[
i].x1 > this->x1max)
1272 this->x1max = (this->points)[
i].x1;
1273 if ((this->points)[
i].x2 < this->x2min)
1274 this->x2min = (this->points)[
i].x2;
1275 if ((this->points)[
i].x2 > this->x2max)
1276 this->x2max = (this->points)[
i].x2;
1277 if ((this->points)[
i].x3 < this->x3min)
1278 this->x3min = (this->points)[
i].x3;
1279 if ((this->points)[
i].x3 > this->x3max)
1280 this->x3max = (this->points)[
i].x3;
1283 this->consistent =
true;
This Class provides basic 3D box objects.
This Class provides basic 3D line objects.
This Class provides basic 3D point objects.
This Class provides basic 3D polygon objects.
std::shared_ptr< T > SPtr
int contains(GbPoint3D *point)
void add(const GbPoint3D &point)
GbPoint3D * getPoint(int index)
GbPoint3D * getLastPoint()
int containsEqual(const GbPoint3D &point)
bool containsEqualLine(const GbPoint3D &point1, const GbPoint3D &point2)
void calculateValues()
*=======================================================*/
void addUnequal(const GbPoint3D &point)
std::vector< GbPoint3D > getPoints()
bool containsLine(GbPoint3D *point1, GbPoint3D *point2)
void insert(const GbPoint3D &point, int index)
GbPoint3D * getFirstPoint()
bool hasIntersectionPoint3D(GbPoint3D &p11, GbPoint3D &p12, GbPoint3D &p21, GbPoint3D &p22)
GbPoint3D * calculateIntersectionPoint3D(GbPoint3D &p11, GbPoint3D &p12, GbPoint3D &p21, GbPoint3D &p22)
bool isParallelIn3D(GbPoint3D &p11, GbPoint3D &p12, GbPoint3D &p21, GbPoint3D &p22)
GbPolygon3D * clipPolygon3D(std::vector< GbPoint3D > points, double x11, double x12, double x13, double x21, double x22, double x23)
double getDistance(const GbPoint3D &p11, const GbPoint3D &p12)
GbCuboid3D * clipRectangle3D(GbPoint3D &p1, GbPoint3D &p2, double x11, double x12, double x13, double x21, double x22, double x23)
GbLine3D * createClipLine3D(GbPoint3D &p1, GbPoint3D &p2, double x11, double x12, double x13, double x21, double x22, double x23)
bool lessEqual(const T1 &value, const T2 &reference)
bool greater2(const T1 &value1, const T2 &value2, T3 toBeGreaterAs1, T4 toBeGreaterAs2)
bool less2(const T1 &value1, const T2 &value2, T3 toBeLessAs1, T4 toBeLessAs2)
bool greater(const T1 &value, const T2 &reference)
bool inClosedInterval(const T1 &value, const T2 &threshold1, const T3 &threshold2)
bool zero(const T &value)
bool less(const T1 &value, const T2 &reference)