diff --git a/Lab5/image.cpp b/Lab5/image.cpp new file mode 100644 index 0000000..e69de29 diff --git a/Lab5/image.h b/Lab5/image.h new file mode 100644 index 0000000..e69de29 diff --git a/Lab5/line.h b/Lab5/line.h new file mode 100644 index 0000000..fb2613d --- /dev/null +++ b/Lab5/line.h @@ -0,0 +1,21 @@ +/** + * @file line.h + * @author your name (you@domain.com) + * @brief + * @version 0.1 + * @date 2022-04-12 + * + * @copyright Copyright (c) 2022 + * + */ + +#include "shape.h" +#include "matrix.h" + +class Line: public Shape{ + public: + + private: + + +} \ No newline at end of file diff --git a/Lab5/shape.cpp b/Lab5/shape.cpp new file mode 100644 index 0000000..20ea8f5 --- /dev/null +++ b/Lab5/shape.cpp @@ -0,0 +1,15 @@ +/** + * @file shape.cpp + * @author your name (you@domain.com) + * @brief + * @version 0.1 + * @date 2022-04-12 + * + * @copyright Copyright (c) 2022 + * + */ +#include "shape.h" + +Shape::Shape(){ + this->RGB = (uint32_t) 0x00FFFFFF; +} \ No newline at end of file diff --git a/Lab5/shape.h b/Lab5/shape.h new file mode 100644 index 0000000..92cddd9 --- /dev/null +++ b/Lab5/shape.h @@ -0,0 +1,30 @@ +#include +#include "x11context.h" + +using namespace std; + +class Shape{ + public: + // Constructor + Shape(); + // Copy Constructor + Shape(const Shape& from); + // Destructor + virtual ~Shape(); + // Virtual Constructor + virtual Shape* clone(); + // Draw shape + virtual void draw(GraphicsContext gc); + // Print to output stream + virtual void out(std::ostream& os, const Shape& rhs); + + + protected: + // Assignment Operator + Shape& operator=(const Shape& rhs); + private: + uint32_t RGB; +}; + + + diff --git a/Lab5/triangle.cpp b/Lab5/triangle.cpp new file mode 100644 index 0000000..e69de29 diff --git a/Lab5/triangle.h b/Lab5/triangle.h new file mode 100644 index 0000000..e69de29 diff --git a/Lecture/Week5/main.cpp b/Lecture/Week5/main.cpp index f7aea8d..a8fbad1 100644 --- a/Lecture/Week5/main.cpp +++ b/Lecture/Week5/main.cpp @@ -1,4 +1,5 @@ #include +#include using namespace std; class Pet{ public: @@ -10,6 +11,10 @@ class Cat: public Pet{ public: int fish; void set_data(int data){fish = data;} + private: + Cat operator+(const Cat& rhs) const{ + + } }; class Bird: public Pet{ @@ -19,10 +24,22 @@ class Bird: public Pet{ }; -int main(){ - Pet* C1 = new Cat; - Pet* C2 = new Cat; - C1->name = "Cat1"; - C1->set_data(1); +template +T doubler(T in){ + T result; + result = in + in; + return result; +} +int main(){ + // Pet* C1 = new Cat; + // Pet* C2 = new Cat; + // C1->name = "Cat1"; + // C1->set_data(1); + // int result = doubler(3); + // cout << "result: " << result << endl; + deque Q; + cout << "size :" << Q.size() << endl; + + return 0; } \ No newline at end of file