Junction Diagram Automation Suite 1.5.1
An AutoCAD 2024 plugin for the manipulation and generation of junction box wiring diagrams
Loading...
Searching...
No Matches
JBox Class Reference

Represents a junction box containing multiple cables. More...

#include <JBox.h>

Public Member Functions

 JBox (std::string tag, std::vector< Cable > cables)
 Constructs a new JBox object.
int GetLeftoverTerminals (BoxSize boxSize) const
 Calculates the number of leftover terminals for a given box size.
std::string GetTag () const
 Gets the tag identifier of the junction box.
void Draw (BoxSize boxSize, AcGeVector3d origin)
 Draws the junction box (function stub).

Detailed Description

Represents a junction box containing multiple cables.

The JBox class encapsulates logic for managing the cables inside a junction box and determining how many terminals remain based on the box size.

Constructor & Destructor Documentation

◆ JBox()

JBox::JBox ( std::string tag,
std::vector< Cable > cables )

Constructs a new JBox object.

Parameters
tagA string identifier for the junction box.
cablesA vector of Cable objects contained within the box.

Member Function Documentation

◆ Draw()

void JBox::Draw ( BoxSize boxSize,
AcGeVector3d origin )

Draws the junction box (function stub).

Draw the cables in this box, arranged based on the size of the box.

Parameters
boxSizeThe size of the box to draw.

◆ GetLeftoverTerminals()

int JBox::GetLeftoverTerminals ( BoxSize boxSize) const

Calculates the number of leftover terminals for a given box size.

For large boxes, the function checks if cables can be distributed across two tables without splitting. If not feasible, it returns -1. For custom-sized boxes, it returns 0.

Parameters
boxSizeThe size of the box (e.g., SMALL, MEDIUM, LARGE, CUSTOM).
Returns
int The number of available terminals, or -1 if placement is not possible.

◆ GetTag()

std::string JBox::GetTag ( ) const

Gets the tag identifier of the junction box.

Returns
std::string The tag string.

The documentation for this class was generated from the following files: