Skip to content

Commit

Permalink
Merge pull request BRL-CAD#14 from SP23-CSCE482/andrews_branch
Browse files Browse the repository at this point in the history
Andrews branch merge
  • Loading branch information
plantand000 authored Mar 28, 2023
2 parents 30cf31c + d3d7ab0 commit 92e6d3d
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
a.out
CMakeCache.txt
/CMakeFiles
/output
38 changes: 37 additions & 1 deletion FactsHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,40 @@ void makeBottomSection(IFPainter& img, InformationGatherer& info, int offsetX, i
//Draw text on top
std::string text = "Preparer: " + info.getInfo("preparer") + " Source File: " + info.getInfo("file") + " Date Generated: " + info.getInfo("dateGenerated") + " Model Checksum: " + info.getInfo("checksum");
img.drawText(offsetX + width / 100, offsetY + height / 1.5, width / 1500, width / 2000, text, false, true);
}
}

void makeFileInfoSection(IFPainter& img, InformationGatherer& info, int offsetX, int offsetY, int width, int height) {
/*
Draw the bounds for the file information section and gather text data
*/
img.drawRect(offsetX, offsetY, offsetX + width, offsetY + height, 3, cv::Scalar(0, 0, 0));

// Store subtitles and data in vectors and loop to display them
std::string Title = "File Information";
std::vector<std::string> subtitles;
std::vector<std::string> data;
}
void makeVerificationSection(IFPainter& img, InformationGatherer& info, int offsetX, int offsetY, int width, int height) {
/*
Draw the bounds for the file information section and gather text data
*/
img.drawRect(offsetX, offsetY, offsetX + width, offsetY + height, 3, cv::Scalar(0, 0, 0));

// Store subtitles and data in vectors and loop to display them
std::string Title = "Verification";
std::vector<std::string> subtitles;
std::vector<std::string> data;
}

void makeHeirarchySection(IFPainter& img, InformationGatherer& info, int offsetX, int offsetY, int width, int height) {
img.drawRect(offsetX, offsetY, offsetX + width, offsetY + height, 3, cv::Scalar(0, 0, 0));
}

void makeVVSection(IFPainter& img, InformationGatherer& info, int offsetX, int offsetY, int width, int height) {
img.drawRect(offsetX, offsetY, offsetX + width, offsetY + height, 3, cv::Scalar(0, 0, 0));

// Store subtitles and data in vectors and loop to display them
std::string Title = "V&V Checks";
std::vector<std::string> subtitles;
std::vector<std::string> data;
}
6 changes: 5 additions & 1 deletion FactsHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@ class InformationGatherer;
class IFPainter;

void makeTopSection(IFPainter& img, InformationGatherer& info, int offsetX, int offsetY, int width, int height);
void makeBottomSection(IFPainter& img, InformationGatherer& info, int offsetX, int offsetY, int width, int height);
void makeBottomSection(IFPainter& img, InformationGatherer& info, int offsetX, int offsetY, int width, int height);
void makeFileInfoSection(IFPainter& img, InformationGatherer& info, int offsetX, int offsetY, int width, int height);
void makeVerificationSection(IFPainter& img, InformationGatherer& info, int offsetX, int offsetY, int width, int height);
void makeHeirarchySection(IFPainter& img, InformationGatherer& info, int offsetX, int offsetY, int width, int height);
void makeVVSection(IFPainter& img, InformationGatherer& info, int offsetX, int offsetY, int width, int height);
Binary file modified a.out
Binary file not shown.
24 changes: 22 additions & 2 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,39 @@ void generateReport(Options opt)
}

// paint renderings
makeRenderSection(img, info, 0, 0, 2400, 2400, opt);
// makeRenderSection(img, info, 0, 100, 1200, 900);
//makeRenderSection(img, info, 0, 0, 2400, 2400, opt);
//makeRenderSection(img, info, 0, 100, 1200, 900, opt);

// paint text sections (no method headers yet)
// paintTitle
// paintSidebar
// etc...

int XY_margin = opt.getWidth() / 150;

makeTopSection(img, info, opt.getWidth() / 150, opt.getWidth() / 150, opt.getWidth() - opt.getWidth() / 150 * 2, opt.getLength() / 25);

makeBottomSection(img, info, opt.getWidth() / 150, opt.getLength() - opt.getLength() / 25 - opt.getWidth() / 150, opt.getWidth() - opt.getWidth() / 150 * 2, opt.getLength() / 25);


// Border width is 3, subtract or add 3 to calculations to align with other boxes
// offsets are based on above section offset + height (or width) of box
int fileSectionOffsetY = (XY_margin) + (opt.getLength() / 25) + (opt.getLength() / 250);
int fileSectionOffsetX = opt.getWidth() - (opt.getWidth() / 4) - (XY_margin);
int fileSectionWidth = (opt.getWidth() / 4) - 3;
int fileSectionHeight = (opt.getLength() / 2) - (XY_margin) - (opt.getLength() / 25) - (opt.getLength() / 250) * 2;
makeFileInfoSection(img, info, fileSectionOffsetX, fileSectionOffsetY, fileSectionWidth, fileSectionHeight);

int VerficationOffsetY = (opt.getLength() - XY_margin - (opt.getLength() / 25) - (opt.getLength() / 250)) - fileSectionHeight;
makeVerificationSection(img, info, fileSectionOffsetX, VerficationOffsetY, fileSectionWidth, fileSectionHeight);

int vvSectionHeight = (opt.getLength() - (opt.getLength() / 25) * 2 - (XY_margin / 2)) / 3;
int vvSectionWidth = ((opt.getWidth() - (fileSectionWidth + 3) - (2*XY_margin)) / 2) - (opt.getLength() / 250);
int vvOffsetY = (opt.getLength() - XY_margin - (opt.getLength() / 25) - (opt.getLength() / 250)) - vvSectionHeight;
makeVVSection(img, info, XY_margin, vvOffsetY, vvSectionWidth, vvSectionHeight);

// Has same height and width as V&V Checks, offset X by V&V checks width
makeHeirarchySection(img, info, XY_margin + vvSectionWidth + (opt.getLength() / 250), vvOffsetY, vvSectionWidth, vvSectionHeight);
// optionally, display the scene
if (opt.getOpenGUI()) {
img.openInGUI();
Expand Down
1 change: 1 addition & 0 deletions pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <cstdlib>
#include <string>
#include <fstream>
#include <vector>
#include <ctime>

// BRL-CAD header files
Expand Down

0 comments on commit 92e6d3d

Please sign in to comment.