kopia lustrzana https://github.com/jameshball/osci-render
				
				
				
			
		
			
				
	
	
		
			31 wiersze
		
	
	
		
			992 B
		
	
	
	
		
			C++
		
	
	
			
		
		
	
	
			31 wiersze
		
	
	
		
			992 B
		
	
	
	
		
			C++
		
	
	
| #pragma once
 | |
| 
 | |
| #include <cmath>
 | |
| #include <cstdlib>
 | |
| #include <vector>
 | |
| #include <memory>
 | |
| #include <string>
 | |
| 
 | |
| class OsciPoint;
 | |
| class Shape {
 | |
| public:
 | |
| 	virtual OsciPoint nextVector(double drawingProgress) = 0;
 | |
| 	virtual void scale(double x, double y, double z) = 0;
 | |
| 	virtual void translate(double x, double y, double z) = 0;
 | |
| 	virtual double length() = 0;
 | |
| 	virtual std::unique_ptr<Shape> clone() = 0;
 | |
| 	virtual std::string type() = 0;
 | |
| 
 | |
| 	static double totalLength(std::vector<std::unique_ptr<Shape>>&);
 | |
| 	static void normalize(std::vector<std::unique_ptr<Shape>>&, double, double);
 | |
| 	static void normalize(std::vector<std::unique_ptr<Shape>>&);
 | |
| 	static double height(std::vector<std::unique_ptr<Shape>>&);
 | |
| 	static double width(std::vector<std::unique_ptr<Shape>>&);
 | |
| 	static OsciPoint maxVector(std::vector<std::unique_ptr<Shape>>&);
 | |
| 	static void removeOutOfBounds(std::vector<std::unique_ptr<Shape>>&);
 | |
| 
 | |
| 	const double INVALID_LENGTH = -1.0;
 | |
| 
 | |
| 	double len = INVALID_LENGTH;
 | |
| };
 |