#include <iostream>
#include <string.h>
using namespace std;
typedef struct Point3D{
double x;
double y;
double z;
}Point3D;
Point3D createPoint3D(double xnum, double ynum, double znum){//функція створення точки
Point3D point;
point.x = xnum;
point.y = ynum;
point.z = znum;
return point;
}
void PrintPoint(Point3D point){//використовується в інщій ф-ції, по суті внутрішня не основна функція
cout << "(" << point.x << ","<< endl;
cout << point.y<< ","<< endl;
cout << point.z<< ";"<< "\n"<< endl;
}
class Obj3D{
private:
Point3D *array_of_points;
int number_of_points;
public:
void setAddPoint(Point3D point){
*(array_of_points + sizeof(point)*number_of_points) = point;
number_of_points++;}
int getNumber(){
return number_of_points;}
Point3D *getArray(){
return array_of_points;}
Obj3D(Point3D point, int number){
number--;
*(array_of_points + number) = point;}
Obj3D(){
*array_of_points = createPoint3D(0.0, 0.0, 0.0);
number_of_points = 1;
}
~Obj3D(){}
};
void printObj(Obj3D Obj){
for(int x = 0; x<=Obj.getNumber(); x++){
}
}
int main(int argc, char* argv[]){
Obj3D Obj;
Point3D point1 = createPoint3D(-0.5,-0.5,-0.5);
Point3D point2 = createPoint3D(0.5,-0.5,-0.5);
Point3D point3 = createPoint3D(-0.5,-0.5,0.5);
Point3D point4 = createPoint3D(0.5,-0.5,0.5);
Point3D point5 = createPoint3D(0.0,0.5,0.0);
Obj.setAddPoint(point1);
Obj.setAddPoint(point2);
Obj.setAddPoint(point3);
Obj.setAddPoint(point4);
Obj.setAddPoint(point5);
cout<<Obj.getArray();
exit(0);
}