-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4ca1e82
commit eccf749
Showing
3 changed files
with
62 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,43 @@ | ||
#include <string.h> | ||
|
||
#include <iostream> | ||
|
||
#include "../include/figure.hpp" | ||
#include "../include/figure_generator.hpp" | ||
#include "figure.hpp" | ||
#include "figure_generator.hpp" // Include the figure_generator header | ||
|
||
inline std::unique_ptr<Figure> generateFigure(int argc, char* argv[]) { | ||
if (argc < 5) { | ||
std::cerr << "Insufficient arguments\n"; | ||
return 0; | ||
return nullptr; | ||
} | ||
|
||
std::string figureType = argv[argc - 1]; | ||
std::string figureName = argv[1]; | ||
|
||
if (figureType == "sphere.3d" && argc == 6) { | ||
if (figureName == "sphere" && figureType == "sphere.3d" && argc == 6) { | ||
// Generate Sphere | ||
std::cout << "Generating Sphere\n"; | ||
return 0; | ||
} else if (figureType == "box.3d" && argc == 5) { | ||
return nullptr; | ||
} else if (figureName == "box" && figureType == "box.3d" && argc == 5) { | ||
// Generate Box | ||
std::cout << "Generating Box\n"; | ||
return 0; | ||
} else if (figureType == "plane.3d" && argc == 5) { | ||
return nullptr; | ||
} else if (figureName == "plane" && figureType == "plane.3d" && argc == 5) { | ||
// Generate Plane | ||
std::cout << "Generating Plane\n"; | ||
return 0; | ||
} else if (figureType == "cone.3d" && argc == 7) { | ||
std::cout << "Generating Plane\n"; // Added newline here | ||
float length = std::stof(argv[2]); | ||
int divisions = std::stoi(argv[3]); | ||
// generatePlane(length, divisions); | ||
return nullptr; | ||
} else if (figureName == "cone" && figureType == "cone.3d" && argc == 7) { | ||
// Generate Cone | ||
std::cout << "Generating Cone\n"; | ||
return 0; | ||
return nullptr; | ||
} else { | ||
std::cerr << "Invalid arguments\n"; | ||
return 0; | ||
return nullptr; | ||
} | ||
return 0; | ||
} | ||
|
||
int main(int argc, char* argv[]) { | ||
std::unique_ptr<Figure> figure = generateFigure(argc, argv); | ||
|
||
return 0; | ||
} | ||
} |