Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 13 / ShapeCollection / ShapeCollection.h
diff options
context:
space:
mode:
Commit110481bee48bdb18f3d635cbc507aac1acc7c694 (patch)
Author
 angeld55 <angel_dimitriev@abv.bg>
2022-05-24 20:10:50 +0300
Committer
 angeld55 <angel_dimitriev@abv.bg>
2022-05-24 20:10:50 +0300
Filesbe2cdf7f8769afd0f456776871b16fe8868ae67b /Sem. 13/ShapeCollection/ShapeCollection.h
Object-oriented_programming_FMI-110481bee48bdb18f3d635cbc507aac1acc7c694.tar
Object-oriented_programming_FMI-110481bee48bdb18f3d635cbc507aac1acc7c694.tar.gz
Object-oriented_programming_FMI-110481bee48bdb18f3d635cbc507aac1acc7c694.zip
Parentc1a310e69933035fb385f52275e9b80cdad695fc (diff)
added shapes collection
1 files changed, 32 insertions, 0 deletions
-rw-r--r--Sem. 13/ShapeCollection/ShapeCollection.h32
diff --git a/Sem. 13/ShapeCollection/ShapeCollection.h b/Sem. 13/ShapeCollection/ShapeCollection.h
new file mode 100644
index 0000000..4adaca7
--- /dev/null
+++ b/Sem. 13/ShapeCollection/ShapeCollection.h
@@ -0,0 +1,32 @@
+#pragma once
+#include "Shape.h"
+
+class ShapeCollection
+{
+ Shape** shapes;
+ size_t shapesCount;
+ size_t capacity;
+
+ void free();
+ void copyFrom(const ShapeCollection& other);
+ void resize();
+
+ void addShape(Shape* shape);
+
+public:
+ ShapeCollection();
+ ShapeCollection(const ShapeCollection& other);
+ ShapeCollection& operator=(const ShapeCollection& other);
+ ~ShapeCollection();
+
+
+ void addRectangle(int x1, int y1, int x3, int y3);
+ void addCircle(int x1, int y1, int r);
+
+ void addTriangle(int x1, int y1, int x2, int y2, int x3, int y3);
+
+ double getPerOfFigureByIndex(size_t ind) const;
+ double getAreaOfFigureByIndex(size_t ind) const;
+ double getIfPointInShapeByIndex(size_t ind, int x,int y) const;
+
+}; \ No newline at end of file