NablaZeroLabs / mxd

Space Mission Design Support Tools
MIT License
4 stars 4 forks source link

Add more uniform setters to program class; add line class and tests #31

Closed fayalalebrun closed 5 years ago

fayalalebrun commented 5 years ago

I've added a few more uniform setters to program, this time taking in glm types. In the program header file, I have decide to include the file GLM/fwd.hpp. This header file forward declares all of the classes in glm, but does not implement them. I did this because glm classes are very laborious to forward declare, making copious use of typedef and other commands. SInce this header file does not include implementation, and only forward declaration, it does not come with the drawbacks that including external headers in a header file has. Thus, I think it is appropriate to use here.

Resolves #14.

fayalalebrun commented 5 years ago

I've added matrix uniform setters for the shader class. This concludes my work on the shader class for now, as with this I will now be able to work on the rest of the graphical components.

fayalalebrun commented 5 years ago

I've added a first implementation of the line class. I have tested it and it does work as expected, however, I still need to write tests for it and continue to work on it for a bit longer. Mainly, I need to solve the problem with needing to use a third party library header in the header, as I detail in the commit message below:

The line class for now compiles its own shader, which giving no access or option to change it to outside classes. Nearly all of the variables are bound to an IDContainer object, a shared pointer of which more pointers are created when a line object is copied. The only variable that is unique to the object is the color.

There is a problem right now upon compilation, with the glm forward declaration header, as it fails upon reaching the unique_ptr in the header file. As a temporary workaround, the proper glm header is used instead. This is of course unnaceptable and will be changed as soon as possible.

fayalalebrun commented 5 years ago

Several variables did not have the private tag in the Program class as was intended. I have fixed this.

fayalalebrun commented 5 years ago

The color field has been made to affect all copied instances of a line class. This with the intention of removing issues concerning the use forward declarations of glm classes in the header file. The unproper use of glm.hpp in the header file was removed, replace with the use of the proper forward declaration fwd.hpp.

The copy constructor and the copy operator have been removed, as they are no longer needed, as the default c++ generated ones will now be enough.

fayalalebrun commented 5 years ago

Certain documentation has been updated to be current with the current line implementation. Functions which do not throw exceptions have been marked appropriately. A function to access the program associated to the line has been added.

fayalalebrun commented 5 years ago

I've added tests for the line class. The function glGetError is used in some of the tests to make sure that OpenGL is not producing any errors.

fayalalebrun commented 5 years ago

I have begun to define the ellipse class.

The ellipse class will generate a number of points based on the user's rX, rY and number_of_points input. It will then draw these to the screen when prompted to, in the future possible with a line mode and a triangle mode.