Skip to content

Commit

Permalink
feat: add generator and visualizer
Browse files Browse the repository at this point in the history
  • Loading branch information
MarioRodrigues10 committed Feb 15, 2024
1 parent 6f98763 commit 8872a76
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ CMakeFiles/*
CMakeCache.txt
*.cmake
Makefile
class1
.vscode
generator
visualizer
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
cmake_minimum_required(VERSION 3.5)

# Project Name
PROJECT(class1)
PROJECT(visualizer)

set_property(GLOBAL PROPERTY USE_FOLDERS ON)

add_executable(${PROJECT_NAME} src/engine.cpp)
add_executable(generator src/generator.cpp)

find_package(OpenGL REQUIRED)
include_directories(${OpenGL_INCLUDE_DIRS})
Expand Down
41 changes: 39 additions & 2 deletions src/generator.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,43 @@
#include <string.h>

#include <iostream>

int main() {
std::cout << "Hello, World!" << std::endl;
#include "../include/figure.hpp"
#include "../include/figure_generator.hpp"

inline std::unique_ptr<Figure> generateFigure(int argc, char* argv[]) {
if (argc < 5) {
std::cerr << "Insufficient arguments\n";
return 0;
}

std::string figureType = argv[argc - 1];

if (figureType == "sphere.3d" && argc == 6) {
// Generate Sphere
std::cout << "Generating Sphere\n";
return 0;
} else if (figureType == "box.3d" && argc == 5) {
// Generate Box
std::cout << "Generating Box\n";
return 0;
} else if (figureType == "plane.3d" && argc == 5) {
// Generate Plane
std::cout << "Generating Plane\n";
return 0;
} else if (figureType == "cone.3d" && argc == 7) {
// Generate Cone
std::cout << "Generating Cone\n";
return 0;
} else {
std::cerr << "Invalid arguments\n";
return 0;
}
return 0;
}

int main(int argc, char* argv[]) {
std::unique_ptr<Figure> figure = generateFigure(argc, argv);

return 0;
}

0 comments on commit 8872a76

Please sign in to comment.