### Set Sticky Node Behavior Source: https://www.adaptagrams.org/documentation/classcola_1_1ConstrainedMajorizationLayout Configures 'sticky' nodes, causing them to spring back to specified start positions (startX, startY) when unconstrained. This requires providing the initial positions and a weight. ```cpp void cola::ConstrainedMajorizationLayout::setStickyNodes( const double _stickyWeight_, const std::valarray& _startX_, const std::valarray& _startY_ ) ``` -------------------------------- ### Get Start Vertex in C++ Source: https://www.adaptagrams.org/documentation/connector_8h_source Retrieves a pointer to the starting vertex of a route or path. This is distinct from the connection's source endpoint and might represent the beginning of a segment. ```cpp VertInf *start(void); ``` -------------------------------- ### buildBestProjSeq() Source: https://www.adaptagrams.org/documentation/classdialect_1_1TreePlacement Builds the best projection sequence for a given tree placement, optionally considering padding, a costlier dimension first strategy, and an expansion estimation method. ```APIDOC ## POST /websites/adaptagrams/buildBestProjSeq ### Description Build the best projection sequence for this tree placement. ### Method POST ### Endpoint /websites/adaptagrams/buildBestProjSeq ### Parameters #### Query Parameters - **_padding_** (double) - Optional - Optional padding for the new tree box. - **_doCostlierDimensionFirst_** (bool) - Optional - Set true to do the more expensive dimension first, in hopes that this will obviate expansion in the other dimension altogether. - **_expansionMethod_** (ExpansionEstimateMethod) - Optional - See defn of ExpansionEstimateMethod enum class. ### Request Example ```json { "_padding_": 0.5, "_doCostlierDimensionFirst_": true, "_expansionMethod_": "CONSTRAINTS" } ``` ### Response #### Success Response (200) - **ProjSeq** (object) - A ProjSeq representing the computed projection sequence. #### Response Example ```json { "ProjSeq": { "some_projection_data": "example" } } ``` ``` -------------------------------- ### Get Source Endpoint Vertex in C++ Source: https://www.adaptagrams.org/documentation/connector_8h_source Retrieves a pointer to the source endpoint vertex within the visibility graph. This is crucial for identifying the starting point of a route. ```cpp VertInf *src(void) const; ``` -------------------------------- ### Build Best Projection Sequence (buildBestProjSeq) Source: https://www.adaptagrams.org/documentation/classdialect_1_1Face Computes the optimal projection sequence for a given tree placement. This function takes a TreePlacement, optional padding, a boolean for dimension ordering, and an expansion estimate method. It returns a ProjSeq and references `doCollateralExpansion` and `vpsc::XDIM`. ```C++ ProjSeq_SP Face::buildBestProjSeq( TreePlacement_SP _tp_, double _padding_ = 0, bool _doCostlierDimensionFirst_ = false, ExpansionEstimateMethod _estimateMethod_ = ExpansionEstimateMethod::CONSTRAINTS ) ``` -------------------------------- ### Get Endpoint Connection Ends in C++ Source: https://www.adaptagrams.org/documentation/connector_8h_source Returns a pair of connection ends representing the start and end points of a connection. This is fundamental for defining the boundaries of routing. ```cpp std::pair endpointConnEnds(void) const; ``` -------------------------------- ### GradientProjection Constructor and Initialization Source: https://www.adaptagrams.org/documentation/gradient__projection_8h_source Initializes the GradientProjection solver with parameters for layout calculation. It takes the dimension, a dense Q matrix, tolerance, maximum iterations, compound constraints, unsatisfiable constraint information, and optional parameters for non-overlap constraints, cluster hierarchy, rectangles, scaling, and MOSEK solver usage. ```cpp GradientProjection( const vpsc::Dim k, std::valarray *denseQ, const double tol, const unsigned max_iterations, CompoundConstraints const *ccs, UnsatisfiableConstraintInfos *unsatisfiableConstraints, NonOverlapConstraintsMode nonOverlapConstraints = None, RootCluster* clusterHierarchy = nullptr, vpsc::Rectangles* rs = nullptr, const bool scaling = false, SolveWithMosek solveWithMosek = Off); ``` -------------------------------- ### Get Graph Ideal Edge Length Source: https://www.adaptagrams.org/documentation/graphs_8h_source Retrieves the ideal edge length for the graph. This value is often used in layout algorithms to guide edge spacing and prevent overlaps. ```cpp double dialect::Graph::getIEL(void) // Read the ideal edge length of this Graph. ``` -------------------------------- ### Initialize libavoid Router Source: https://www.adaptagrams.org/documentation/libavoid_example Demonstrates how to create an instance of the Avoid::Router. The router is initialized with a specified routing mode, such as PolyLineRouting. ```cpp Avoid::Router *router = new Avoid::Router(Avoid::PolyLineRouting); ``` -------------------------------- ### Get Current Time Formatting in C++ (POSIX) Source: https://www.adaptagrams.org/documentation/topology__log_8h_source Provides a function to get the current time formatted as HH:MM:SS.milliseconds on POSIX-compliant systems. It uses `strftime`, `localtime_r`, `gettimeofday`, and `sys/time.h`. Dependencies include `` and ``. ```C++ #else #include #include #include inline std::string NowTime() { char buffer[11]; time_t t; time(&t); tm r; strftime(buffer, sizeof(buffer), "%X", localtime_r(&t, &r)); struct timeval tv; gettimeofday(&tv, 0); std::stringstream result; result << buffer << "." << std::setfill('0') << std::setw(3) << ((long)tv.tv_usec / 1000); return result.str(); } #endif //WIN32 ``` -------------------------------- ### C++ MultiSeparationConstraint Constructor and Usage Source: https://www.adaptagrams.org/documentation/classcola_1_1MultiSeparationConstraint Demonstrates the construction and basic usage of the MultiSeparationConstraint class in C++. It includes initializing the constraint with a dimension, minimum separation, and equality flag, and adding alignment pairs. ```cpp #include #include #include // Example usage void exampleMultiSeparationConstraint() { vpsc::Dim dimension = vpsc::HORIZONTAL; // Or vpsc::VERTICAL double minSeparation = 10.0; bool isEquality = false; cola::MultiSeparationConstraint multiSepConstraint(dimension, minSeparation, isEquality); // Assume ac1 and ac2 are valid AlignmentConstraint pointers // cola::AlignmentConstraint *ac1 = ...; // cola::AlignmentConstraint *ac2 = ...; // multiSepConstraint.addAlignmentPair(ac1, ac2); // multiSepConstraint.setSeparation(20.0); // std::string description = multiSepConstraint.toString(); // std::cout << description << std::endl; } ``` -------------------------------- ### Detailed Description Source: https://www.adaptagrams.org/documentation/namespacevpsc Provides a detailed overview of the libvpsc library, emphasizing its purpose as a quadratic program solver for variable placement. ```APIDOC ## Detailed Description libvpsc: Variable Placement with Separation Constraints quadratic program solver library. You should use VPSC via an instance of the IncSolver or Solver classes. ``` -------------------------------- ### Get Current Time Formatting in C++ (Windows) Source: https://www.adaptagrams.org/documentation/topology__log_8h_source Provides a function to get the current time formatted as HH:MM:SS.milliseconds on Windows systems. It uses `GetTimeFormatA` and `GetTickCount` for time and millisecond retrieval. Dependencies include `` and ``. ```C++ #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) #include #include #include inline std::string NowTime() { const int MAX_LEN = 200; char buffer[MAX_LEN]; if (GetTimeFormatA(LOCALE_USER_DEFAULT, 0, 0, "HH':'mm':'ss", buffer, MAX_LEN) == 0) return "Error in NowTime()"; static DWORD first = GetTickCount(); std::stringstream result; result << buffer << "." << std::setfill('0') << std::setw(3) << ((long)(GetTickCount() - first) % 1000); return result.str(); } #endif //WIN32 ``` -------------------------------- ### topology::AvoidTopologyAddon Constructor Source: https://www.adaptagrams.org/documentation/classtopology_1_1AvoidTopologyAddon-members This section details the constructor for the topology::AvoidTopologyAddon class. It outlines the parameters required for its initialization, including rectangles, constraints, root cluster, variable ID map, and an optional move limit. ```cpp AvoidTopologyAddon(vpsc::Rectangles &rs, cola::CompoundConstraints &cs, cola::RootCluster *ch, cola::VariableIDMap &map, const double moveLimit=120); ``` -------------------------------- ### Get Router Source: https://www.adaptagrams.org/documentation/classAvoid_1_1ClusterRef Retrieves a pointer to the router scene the cluster is part of. ```APIDOC ## GET /websites/adaptagrams/router ### Description Returns a pointer to the router scene this cluster is in. ### Method GET ### Endpoint /websites/adaptagrams/router ### Parameters None ### Request Example None ### Response #### Success Response (200) - **router** (Router*) - A pointer to the router scene for this cluster. #### Response Example ```json { "router": "..." } ``` ``` -------------------------------- ### ColaTopologyAddon Constructor (Empty) Source: https://www.adaptagrams.org/documentation/classtopology_1_1ColaTopologyAddon Constructs an empty ColaTopologyAddon instance for collecting topology information. When libcola runs, it populates this instance with topology data for nodes and edges, which can then be accessed via topologyNodes and topologyRoutes. ```cpp #include // Constructs an empty ColaTopologyAddon instance topology::ColaTopologyAddon addon; ``` -------------------------------- ### Get Polygon Boundary Source: https://www.adaptagrams.org/documentation/classAvoid_1_1ClusterRef Retrieves a reference to the polygon boundary of the cluster. ```APIDOC ## GET /websites/adaptagrams/polygon ### Description Returns a reference to the polygon boundary of this cluster. ### Method GET ### Endpoint /websites/adaptagrams/polygon ### Parameters None ### Request Example None ### Response #### Success Response (200) - **polygon** (Polygon) - A reference to the polygon boundary of the cluster. #### Response Example ```json { "polygon": "..." } ``` ``` -------------------------------- ### RectangularCluster Padding API Source: https://www.adaptagrams.org/documentation/classcola_1_1RectangularCluster Provides methods to get and set the padding for a RectangularCluster. ```APIDOC ## padding() ### Description Returns the padding box for this cluster. ### Method GET ### Endpoint `/websites/adaptagrams/padding` ### Response #### Success Response (200) - **padding_box** (Box) - The padding box for the cluster. #### Response Example ```json { "padding_box": { "x": 0, "y": 0, "width": 0, "height": 0 } } ``` ## setPadding(double padding) ### Description Sets the padding size for this cluster. This value represents the inner spacing that will be put between the cluster boundary and other child clusters (plus their margin) and child rectangles on all sides. ### Method POST ### Endpoint `/websites/adaptagrams/setPadding/double` ### Parameters #### Request Body - **padding** (double) - The size of the padding for this cluster. ### Request Example ```json { "padding": 10.0 } ``` ### Response #### Success Response (200) - **message** (string) - Indicates successful update. #### Response Example ```json { "message": "Padding set successfully." } ``` ## setPadding(const Box& padding) ### Description Sets the padding box for this cluster. This box represents the inner spacing that will be put between the cluster boundary and other child clusters (plus their margin) and child rectangles for each edge. ### Method POST ### Endpoint `/websites/adaptagrams/setPadding/box` ### Parameters #### Request Body - **padding** (Box) - The Box representing padding values for this cluster. ### Request Example ```json { "padding": { "x": 5, "y": 5, "width": 15, "height": 15 } } ``` ### Response #### Success Response (200) - **message** (string) - Indicates successful update. #### Response Example ```json { "message": "Padding box set successfully." } ``` ``` -------------------------------- ### vpsc::Solver Class Documentation Source: https://www.adaptagrams.org/documentation/classvpsc_1_1Solver Documentation for the vpsc::Solver class, including its public and protected member functions for solving Variable Placement with Separation Constraints problems. ```APIDOC ## vpsc::Solver Class Static solver for Variable Placement with Separation Constraints problem instance. This class attempts to solve a least-squares problem subject to a set of separation constraints. The `solve()` and `satisfy()` methods return true if any constraints are active, in both cases false means an unconstrained optimum has been found. ### Public Member Functions * **virtual bool satisfy()** * **Description**: Results in an approximate solution subject to the constraints. Returns true if any constraints are active, or false if an unconstrained optimum has been found. * **Details**: Produces a feasible - though not necessarily optimal - solution by examining blocks in the partial order defined by the directed acyclic graph of constraints. For each block (when processing left to right) we maintain the invariant that all constraints to the left of the block (incoming constraints) are satisfied. This is done by repeatedly merging blocks into bigger blocks across violated constraints (most violated first) fixing the position of variables inside blocks relative to one another so that constraints internal to the block are satisfied. * **Reimplemented in**: `vpsc::IncSolver` * **virtual bool solve()** * **Description**: Results in an optimum solution subject to the constraints. Returns true if any constraints are active, or false if an unconstrained optimum has been found. * **Details**: Calculate the optimal solution. After using `satisfy()` to produce a feasible solution, `refine()` examines each block to see if further refinement is possible by splitting the block. This is done repeatedly until no further improvement is possible. * **Reimplemented in**: `vpsc::IncSolver` * **Variables const & getVariables()** * **Description**: Returns the Variables in this problem instance. * **Returns**: A vector of Variable objects. ### Protected Member Functions * **void copyResult()** * **Description**: Stores the relative positions of the variables in their `finalPosition` field. ``` -------------------------------- ### ColaTopologyAddon Constructor (With Topology Data) Source: https://www.adaptagrams.org/documentation/classtopology_1_1ColaTopologyAddon Constructs a ColaTopologyAddon instance with pre-existing topology information for nodes and edges. This allows libcola to generate topology-preserving constraints during layout to ensure the network's topology is maintained. ```cpp #include #include // Assuming topology::Nodes and topology::Edges are defined here // Assuming tnodes and routes are pre-populated topology::Nodes and topology::Edges objects topology::Nodes tnodes; topology::Edges routes; // Constructs a ColaTopologyAddon instance with specified topology data topology::ColaTopologyAddon addon(tnodes, routes); ``` -------------------------------- ### GET /websites/adaptagrams/polygon Source: https://www.adaptagrams.org/documentation/classAvoid_1_1ShapeRef Retrieves a reference to the polygon boundary of a shape. ```APIDOC ## GET /polygon ### Description Returns a reference to the polygon boundary of this shape. ### Method GET ### Endpoint /websites/adaptagrams/polygon ### Parameters #### Path Parameters None #### Query Parameters None ### Request Example (No request body for GET) ### Response #### Success Response (200) - **polygon** (Polygon&) - A reference to the polygon boundary of the shape. #### Response Example ```json { "polygon": { "vertices": [ {"x": 0, "y": 0}, {"x": 10, "y": 0}, {"x": 10, "y": 10}, {"x": 0, "y": 10} ] } } ``` ``` -------------------------------- ### Get Rectangular Polygon Boundary Source: https://www.adaptagrams.org/documentation/classAvoid_1_1ClusterRef Retrieves a reference to the rectangular boundary of the cluster. ```APIDOC ## GET /websites/adaptagrams/rectangularPolygon ### Description Returns a reference to the rectangular boundary of this cluster. ### Method GET ### Endpoint /websites/adaptagrams/rectangularPolygon ### Parameters None ### Request Example None ### Response #### Success Response (200) - **polygon** (Polygon) - A reference to the rectangular boundary of the cluster. #### Response Example ```json { "polygon": "..." } ``` ``` -------------------------------- ### Face::buildBestProjSeq: Build Projection Sequence for TreePlacement (C++) Source: https://www.adaptagrams.org/documentation/treeplacement_8h_source Builds the best projection sequence for a given TreePlacement. This function belongs to the Face class and takes a TreePlacement object as input, along with optional parameters for padding, dimension prioritization, and estimation method. ```cpp dialect::Face::buildBestProjSeq ProjSeq_SP buildBestProjSeq(TreePlacement_SP tp, double padding=0, bool doCostlierDimensionFirst=false, ExpansionEstimateMethod estimateMethod=ExpansionEstimateMethod::CONSTRAINTS) Build the best projection sequence for a given tree placement. **Definition:** faces.cpp:585 ``` -------------------------------- ### ACALayout Constructor (Rectangles and Edges) Source: https://www.adaptagrams.org/documentation/classdialect_1_1ACALayout Constructs an adaptive constrained alignment layout instance using rectangles, edges, and constraints. ```APIDOC ## ACALayout() [1/2] ### Description Constructs an adaptive constrained alignment layout instance. Parameters are the same as for the ConstrainedFDLayout constructor, with the addition of a vector of constraints passed by reference. If the vector of constraints is non-empty, these constraints will be applied throughout the ACA process, and the new constraints created by ACA will not conflict with any of these. In any case, the new constraints generated by ACA are added to this vector. ### Method ACALayout ### Endpoint N/A (Constructor) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ### Parameters Details - **rs** (const vpsc::Rectangles &) - The bounding boxes of the nodes at their initial positions. - **es** (const std::vector< cola::Edge > &) - The edges, given as simple pairs of indices (i, j) into the rectangle vector rs. - **ccs** (cola::CompoundConstraints &) - Vector of any pre-existing constraints, and the place where new constraints created by ACA will be recorded. - **idealLength** (const double) - The "ideal edge length" parameter for the stress function, i.e. the ideal separation between neighbouring nodes. If eLengths (see below) is specified, then this parameter becomes instead a scalar multiplier for the lengths given there. - **eLengths** (const cola::EdgeLengths &) - Individual ideal lengths for edges. The actual ideal length used for the ith edge is idealLength*eLengths[i]. If eLengths is not passed, then just idealLength is used (as if eLengths[i] were equal to 1 for all i). - **doneTest** (cola::TestConvergence *) - A test of convergence operation called at the end of each iteration (optional). If not given, uses a default TestConvergence object. - **preIteration** (cola::PreIteration *) - An operation to be called before each iteration (optional). ``` -------------------------------- ### Rectangle Geometric Getters and Setters (C++) Source: https://www.adaptagrams.org/documentation/rectangle_8h_source Provides methods to get and set the minimum and maximum X and Y coordinates of a rectangle, as well as its width and height. It also includes functions to get the center coordinates along a specified axis. Dependencies include basic arithmetic operations and assertions. ```C++ double getMinX() const { return minX; } double getMaxX() const { return maxX; } double getMinY() const { return minY; } double getMaxY() const { return maxY; } void setMinD(unsigned const d, const double val) { if ( d == 0) { minX = val; } else { minY = val; } } void setMaxD(unsigned const d, const double val) { if ( d == 0) { maxX = val; } else { maxY = val; } } double getCentreX() const { return getMinX()+width()/2.0; } double getCentreY() const { return getMinY()+height()/2.0; } double getCentreD(unsigned const d) const { COLA_ASSERT(d==0||d==1); return getMinD(d)+length(d)/2.0; } double width() const { return getMaxX()-getMinX(); } double height() const { return getMaxY()-getMinY(); } double length(unsigned const d) const { COLA_ASSERT(d==0||d==1); return ( d == 0 ? width() : height() ); } void set_width(double w) { maxX = minX + w - 2.0*xBorder; } void set_height(double h) { maxY = minY + h - 2.0*yBorder; } ``` -------------------------------- ### GET /websites/adaptagrams/position Source: https://www.adaptagrams.org/documentation/classAvoid_1_1ShapeConnectionPin Retrieves the position of the connection pin within the graphical context. ```APIDOC ## GET /websites/adaptagrams/position ### Description Returns the position of this connection pin. The position is represented by a Point object. ### Method GET ### Endpoint /websites/adaptagrams/position ### Parameters None ### Request Example None ### Response #### Success Response (200) - **position** (object) - An object representing the position with `x` and `y` coordinates. - **x** (number) - The x-coordinate of the position. - **y** (number) - The y-coordinate of the position. #### Response Example { "position": { "x": 100, "y": 50 } } ``` -------------------------------- ### GradientProjection Get Dimension Method Source: https://www.adaptagrams.org/documentation/gradient__projection_8h_source Returns the dimensionality of the layout problem being solved by the GradientProjection instance. ```cpp vpsc::Dim getDimension() const { return k; } ``` -------------------------------- ### Layout Options API Source: https://www.adaptagrams.org/documentation/graphs_8h_source Configuration options for the libavoid layout algorithms. ```APIDOC ## ColaOptions Class Provides options for libcola layout methods. **Definition:** graphs.h:105 ### double idealEdgeLength The ideal length for edges in the layout. **Definition:** graphs.h:108 ### bool xAxis Specifies whether to perform layout along the x-axis. **Definition:** graphs.h:117 ### cola::CompoundConstraints ccs Compound constraints for the layout. **Definition:** graphs.h:141 ### EdgesById solidEdgeExemptions Edges that should be exempt from solidification. **Definition:** graphs.h:115 ``` -------------------------------- ### ColaTopologyAddon Class Documentation (C++) Source: https://www.adaptagrams.org/documentation/cola__topology__addon_8h_source Provides an overview of the ColaTopologyAddon class, detailing its purpose as an extension for libcola to enable topology-preserving layouts. It highlights its role in replacing specific functionalities to maintain topological integrity during the layout process. ```cpp /* * libtopology - Classes used in generating and managing topology constraints. * * Copyright (C) 2012 Monash University * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * See the file LICENSE.LGPL distributed with the library. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * Author: Michael Wybrow */ #ifndef LAYOUT_TOPOLOGY_CONNECTOR_H #define LAYOUT_TOPOLOGY_CONNECTOR_H // ... (include directives) ... namespace topology { class ColaTopologyAddon : public cola::TopologyAddonInterface { // ... (class members) ... }; } // namespace topology #endif // LAYOUT_TOPOLOGY_CONNECTOR_H ``` -------------------------------- ### GET /websites/adaptagrams/isExclusive Source: https://www.adaptagrams.org/documentation/classAvoid_1_1ShapeConnectionPin Checks if a connection pin is exclusive, meaning only one connector can attach to it. ```APIDOC ## GET /websites/adaptagrams/isExclusive ### Description Returns whether the connection pin is exclusive. An exclusive pin allows only a single connector to attach to it. ### Method GET ### Endpoint /websites/adaptagrams/isExclusive ### Parameters None ### Request Example None ### Response #### Success Response (200) - **exclusive** (boolean) - A boolean value indicating if the pin is exclusive. #### Response Example { "exclusive": true } ``` -------------------------------- ### Get New and Deleted Object Lists Source: https://www.adaptagrams.org/documentation/classAvoid_1_1HyperedgeRerouter Retrieves details of junctions and connectors created or deleted during hyperedge improvement. ```APIDOC ## GET /websites/adaptagrams/hyperedgeRerouter/{index} ### Description Returns a `HyperedgeNewAndDeletedObjectLists` object detailing the lists of junctions and connectors created and deleted during the hyperedge improvement process for a specific registered index. ### Method GET ### Endpoint `/websites/adaptagrams/hyperedgeRerouter/{index}` ### Parameters #### Path Parameters - **index** (size_t) - Required - The index obtained when registering the hyperedge for rerouting. ### Response #### Success Response (200) - **HyperedgeNewAndDeletedObjectLists** (object) - An object containing lists of created and deleted junctions and connectors. - **created_junctions** (JunctionRefList) - List of newly created junctions. - **deleted_junctions** (JunctionRefList) - List of deleted junctions. - **created_connectors** (ConnRefList) - List of newly created connectors. - **deleted_connectors** (ConnRefList) - List of deleted connectors. ### Response Example ```json { "created_junctions": [], "deleted_junctions": [], "created_connectors": [], "deleted_connectors": [] } ``` ``` -------------------------------- ### Run Layout Algorithm Once Source: https://www.adaptagrams.org/documentation/classcola_1_1ConstrainedFDLayout Executes a single iteration of the layout algorithm. This is useful when a full convergence is not necessary or when implementing custom callback mechanisms. ```APIDOC ## POST /websites/adaptagrams/runOnce ### Description Same as run(), but only applies one iteration. This may be useful when it's too hard to implement a call-back (e.g., in java apps). ### Method POST ### Endpoint /websites/adaptagrams/runOnce ### Parameters #### Path Parameters None #### Query Parameters - **x** (bool) - Optional - If true, layout will be performed in x-dimension (default: true). - **y** (bool) - Optional - If true, layout will be performed in y-dimension (default: true). #### Request Body None ### Request Example None ### Response #### Success Response (200) - **status** (string) - Indicates the single layout iteration completed. ``` -------------------------------- ### TreePlacement::getGrowthDir: Get Growth Direction (C++) Source: https://www.adaptagrams.org/documentation/treeplacement_8h_source Retrieves the growth direction (CardinalDir) for this TreePlacement. This is a const method. ```cpp dialect::TreePlacement::getGrowthDir CardinalDir getGrowthDir(void) const Get the growth direction. **Definition:** treeplacement.h:81 ``` -------------------------------- ### TreePlacement::buildBestProjSeq: Build Projection Sequence (C++) Source: https://www.adaptagrams.org/documentation/treeplacement_8h_source Builds the best projection sequence for a TreePlacement. It can optionally consider costlier dimensions first and uses a specified expansion estimation method. This method is part of the TreePlacement class. ```cpp dialect::TreePlacement::buildBestProjSeq ProjSeq_SP buildBestProjSeq(double padding=0, bool doCostlierDimensionFirst=false, ExpansionEstimateMethod expansionMethod=ExpansionEstimateMethod::CONSTRAINTS) Build the best projection sequence for this tree placement. **Definition:** treeplacement.h:146 ``` -------------------------------- ### Project Website Adaptagrams Source: https://www.adaptagrams.org/documentation/obstacle_8h_source This section outlines information related to the '/websites/adaptagrams' project, which seems to be related to graphical routing and connection management. ```APIDOC ## Project Information ### Description Information pertaining to the '/websites/adaptagrams' project. This project appears to be part of a library for object-avoiding orthogonal and polyline connector routing. ### Endpoints **Note:** Specific endpoints for this project are not detailed in the provided text. The following represents potential functionalities based on the library's purpose. #### Example Functionality: Get Possible Pin Points ##### Description Retrieves a list of possible connection points for a given pin class ID. ##### Method GET ##### Endpoint `/websites/adaptagrams/pins/{pinClassId}/points` ##### Parameters ###### Path Parameters * **pinClassId** (unsigned int) - Required - The unique identifier for the pin class. ###### Query Parameters None ###### Request Body None ##### Request Example None ##### Response ###### Success Response (200) * **points** (array of objects) - A list of connection points, where each point has 'x' and 'y' coordinates. * **x** (number) - The x-coordinate of the point. * **y** (number) - The y-coordinate of the point. ###### Response Example ```json { "points": [ { "x": 10, "y": 20 }, { "x": 15, "y": 25 } ] } ``` #### Example Functionality: Assign Pin Visibility ##### Description Assigns visibility settings for a pin based on its class ID and a dummy connection vertex. ##### Method POST ##### Endpoint `/websites/adaptagrams/pins/visibility` ##### Parameters ###### Path Parameters None ###### Query Parameters None ###### Request Body * **pinClassId** (unsigned int) - Required - The unique identifier for the pin class. * **dummyConnectionVert** (object) - Required - A pointer to a dummy connection vertex. ##### Request Example ```json { "pinClassId": 1, "dummyConnectionVert": null // Placeholder for the actual vertex object representation } ``` ##### Response ###### Success Response (200) * **message** (string) - A confirmation message indicating the pin visibility was assigned. ###### Response Example ```json { "message": "Pin visibility assigned successfully." } ``` ``` -------------------------------- ### TreePlacement::getPlacementDir: Get Placement Direction (C++) Source: https://www.adaptagrams.org/documentation/treeplacement_8h_source Retrieves the placement direction (CompassDir) for this TreePlacement. This is a const method. ```cpp dialect::TreePlacement::getPlacementDir CompassDir getPlacementDir(void) const Get the placement direction. **Definition:** treeplacement.h:78 ``` -------------------------------- ### Router Constructor Source: https://www.adaptagrams.org/documentation/classAvoid_1_1Router Constructs a new Router instance with optional flags to control its behavior. ```APIDOC ## Router() ### Description Constructor for router instance. ### Method Constructor ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response None ### Remarks Flags can be used to control the behavior of the router. Refer to the libavoid documentation for available flags. ``` -------------------------------- ### GET /websites/adaptagrams/directions Source: https://www.adaptagrams.org/documentation/classAvoid_1_1ShapeConnectionPin Retrieves the visibility directions for a connection pin. This indicates where connectors can attach to the pin. ```APIDOC ## GET /websites/adaptagrams/directions ### Description Returns the directions in which this connection pin has visibility. This is useful for understanding where connectors can attach to the pin. ### Method GET ### Endpoint /websites/adaptagrams/directions ### Parameters None ### Request Example None ### Response #### Success Response (200) - **directions** (list of strings) - The visibility directions for this connection pin. Possible values include: - `ConnDirAll` - `ConnDirDown` - `ConnDirLeft` - `ConnDirRight` - `ConnDirUp` #### Response Example { "directions": ["ConnDirLeft", "ConnDirRight"] } ``` -------------------------------- ### Tree Construction and Integration Methods Source: https://www.adaptagrams.org/documentation/trees_8h_source Includes methods for constructing parts of the tree and integrating it with other components. `buildRootlessBox` creates a bounding box for the tree without a root, while `addNetworkToRoutingAdapter`, `addNetwork`, `addConstraints`, and `addBufferNodesAndConstraints` are used to add the tree's network structure, constraints, and buffer nodes to routing adapters or graphs. ```cpp Node_SP buildRootlessBox(CardinalDir growthDir) const; void addNetworkToRoutingAdapter(RoutingAdapter &ra, TreeRoutingType trt, Graph_SP core = nullptr); void addNetwork(Graph &G, NodesById &treeNodes, EdgesById &treeEdges); void addConstraints(Graph &G, bool alignRoot); void addBufferNodesAndConstraints(Graph &G, NodesById &bufferNodes); ``` -------------------------------- ### Get Hyperedge Rerouter Source: https://www.adaptagrams.org/documentation/router_8h_source Returns a pointer to the HyperedgeRerouter object associated with the router. This object is responsible for rerouting hyperedges. ```C++ HyperedgeRerouter *hyperedgeRerouter(void); ``` -------------------------------- ### NodeBuckets Initialization Source: https://www.adaptagrams.org/documentation/peeling_8h_source Initializes a set of node buckets for a given Graph. ```APIDOC ## NodeBuckets Constructor ### Description Initializes a set of node buckets for the given Graph. ### Method CONSTRUCTOR ### Endpoint `dialect::NodeBuckets::NodeBuckets(Graph &graph)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "No request body for constructor" } ``` ### Response #### Success Response (200) - **NodeBuckets** (object) - An instance of NodeBuckets initialized with the graph. #### Response Example ```json { "example": "NodeBuckets object" } ``` ``` -------------------------------- ### Get Debug Handler Source: https://www.adaptagrams.org/documentation/router_8h_source Returns the currently assigned debug handler for the router. If no handler is set, it may return null. ```C++ DebugHandler *debugHandler(void) const; ``` -------------------------------- ### TreePlacement::toString: Get String Representation (C++) Source: https://www.adaptagrams.org/documentation/treeplacement_8h_source Provides a string representation of the TreePlacement object, useful for debugging or logging. This is a const method. ```cpp dialect::TreePlacement::toString std::string toString(void) const Get a string representation. **Definition:** treeplacement.cpp:173 ``` -------------------------------- ### Polygon Constructors Source: https://www.adaptagrams.org/documentation/classAvoid_1_1Polygon Provides documentation for the two constructors of the Polygon class: one that creates a polygon with a specified number of points, and another that copies an existing polygon. ```APIDOC ## POST /websites/adaptagrams/Polygon() ### Description Constructs a new polygon with n points. A rectangle would be comprised of four points. An n segment PolyLine (represented as a Polygon) would be comprised of n+1 points. Whether a particular Polygon is closed or not, depends on whether it is a Polygon or Polyline. Shape polygons are always considered to be closed, meaning the last point joins back to the first point. The values for points can be set by setting the Polygon:ps vector, or via the Polygon::setPoint() method. ### Method POST ### Endpoint /websites/adaptagrams/Polygon() ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **n** (int) - Required - Number of points in the polygon. ### Request Example ```json { "n": 4 } ``` ### Response #### Success Response (200) - **polygon** (Polygon) - A new polygon object. #### Response Example ```json { "polygon": "Polygon object details" } ``` ## POST /websites/adaptagrams/Polygon() ### Description Constructs a new polygon from an existing Polygon. ### Method POST ### Endpoint /websites/adaptagrams/Polygon() ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **poly** (PolygonInterface) - Required - An existing polygon to copy the new polygon from. ### Request Example ```json { "poly": "PolygonInterface object details" } ``` ### Response #### Success Response (200) - **polygon** (Polygon) - A new polygon object. #### Response Example ```json { "polygon": "Polygon object details" } ``` ``` -------------------------------- ### Initialize Router with Flags Source: https://www.adaptagrams.org/documentation/router_8h_source Constructor for the Router class, initializing the routing environment with a specified set of flags. These flags control various aspects of the routing process. ```C++ Router(const unsigned int flags); ``` -------------------------------- ### TreePlacement::getBoxNode: Get Tree Box Node (C++) Source: https://www.adaptagrams.org/documentation/treeplacement_8h_source Retrieves the Node object representing the bounding box of the tree. This is a const method. ```cpp dialect::TreePlacement::getBoxNode Node_SP getBoxNode(void) Get the box node. **Definition:** treeplacement.h:138 ``` -------------------------------- ### Get Next Projection in C++ Source: https://www.adaptagrams.org/documentation/constraints_8h_source Retrieves the next Projection from the sequence, if one exists. This is useful for iterating through a sequence of projections. ```cpp Projection_SP dialect::ProjSeq::nextProjection(void) Get the next Projection, if any. **Definition:** constraints.cpp:1037 ``` -------------------------------- ### Topology Addon Management Source: https://www.adaptagrams.org/documentation/classAvoid_1_1Router Methods for setting a topology addon for orthogonal topology improvement. ```APIDOC ## setTopologyAddon (topologyAddon) ### Description Set an addon for doing orthogonal topology improvement. ### Method POST ### Endpoint `/websites/adaptagrams/router/setTopologyAddon` ### Parameters #### Query Parameters * **topologyAddon** (TopologyAddonInterface *) - Required - A pointer to the topology addon interface. ### Request Example None ### Response #### Success Response (200) None ``` -------------------------------- ### Constraint Class Constructor Documentation (C++) Source: https://www.adaptagrams.org/documentation/classvpsc_1_1Constraint Documents the constructor for the `vpsc::Constraint` class, which creates a spacing constraint between two `Variable` objects. It outlines the parameters for specifying the left and right variables, the gap (distance), and whether the constraint is for an exact distance or a minimum distance. ```cpp #include vpsc::Constraint::Constraint(Variable *_left, Variable *_right, double _gap, bool _equality = false) ``` -------------------------------- ### getNumTreesByGrowthDir Source: https://www.adaptagrams.org/documentation/classdialect_1_1Face After tree placements have been chosen and performed, get a count of trees by growth direction. Optionally scales counts by the number of nodes per tree. ```APIDOC ## GET /websites/adaptagrams/getNumTreesByGrowthDir ### Description After tree placements have been chosen and performed, get a count of trees by growth direction. ### Method GET ### Endpoint /websites/adaptagrams/getNumTreesByGrowthDir ### Parameters #### Path Parameters None #### Query Parameters - **counts** (std::map< CardinalDir, size_t > &) - Output parameter - Map into which the counts should be added. - **scaleBySize** (bool) - Optional - Set true if for each tree you want to count its number of nodes. Defaults to false. ### Request Example ```json { "scaleBySize": true } ``` ### Response #### Success Response (200) - **counts** (std::map< CardinalDir, size_t >) - A map where keys are Cardinal Directions and values are the counts of trees (or nodes if scaleBySize is true). #### Response Example ```json { "counts": { "North": 5, "South": 3, "East": 7, "West": 2 } } ``` ``` -------------------------------- ### Get BendSequence Size Source: https://www.adaptagrams.org/documentation/chains_8h_source Returns the number of bends present in a `BendSequence`. This is a const member function of the `dialect::BendSequence` class. ```C++ size_t size(void) const // Report the number of bends in the sequence. ``` -------------------------------- ### Apply Projection Sequence (applyProjSeq) Source: https://www.adaptagrams.org/documentation/classdialect_1_1Face A convenience function to apply a ProjSeq with default options. It takes a ProjSeq as input and returns a boolean indicating the success of all projections. It references `dialect::ColaOptions::preventOverlaps` and `dialect::ColaOptions::solidifyAlignedEdges`. ```C++ bool Face::applyProjSeq(ProjSeq& _ps_) ``` -------------------------------- ### vpsc Library Components in C++ Source: https://www.adaptagrams.org/documentation/constraints_8h_source Documentation related to the vpsc (Variable Placement with Separation Constraints) library, including its core components like Variable, Variables, Constraint, Constraints, and Rectangles. This library is used for solving quadratic placement problems. ```cpp vpsc::Variables std::vector< Variable * > Variables A vector of pointers to Variable objects. **Definition:** constraint.h:38 vpsc::Constraints std::vector< Constraint * > Constraints A vector of pointers to Constraint objects. **Definition:** constraint.h:125 vpsc::Constraint A constraint determines a minimum or exact spacing required between two Variable objects. **Definition:** constraint.h:44 vpsc::Rectangles std::vector< Rectangle * > Rectangles A vector of pointers to Rectangle objects. **Definition:** rectangle.h:246 ``` -------------------------------- ### Get GhostNode ID Source: https://www.adaptagrams.org/documentation/graphs_8h_source Returns an appropriate ID number for a GhostNode. This is a virtual function and must be implemented by derived classes. ```cpp virtual id_type dialect::GhostNode::id(void) const // Return an appropriate ID number. ``` -------------------------------- ### Get Routing Parameter Value Source: https://www.adaptagrams.org/documentation/router_8h_source Retrieves the current value of a specified routing parameter. This allows inspection of the active routing configuration. ```C++ double routingParameter(const RoutingParameter parameter) const; ``` -------------------------------- ### ExpansionManager Class Source: https://www.adaptagrams.org/documentation/classdialect_1_1ExpansionManager Documentation for the ExpansionManager class, including its constructor and various methods for estimating expansion costs and extending projection sequences. ```APIDOC ## ExpansionManager Class ### Description Represents the ExpansionManager class, responsible for managing expansion processes within Adaptagrams. ### Constructor **ExpansionManager** (TreePlacement_SP tp, vpsc::Dim primaryDim=vpsc::HORIZONTAL, double padding=-1) Standard constructor for the ExpansionManager. ### Public Member Functions #### isAxial **bool** `isAxial` (vpsc::Dim dim) Check whether a given dimension is axial with respect to this manager's placement. #### isTransverse **bool** `isTransverse` (vpsc::Dim dim) Check whether a given dimension is transverse with respect to this manager's placement. #### estimateCost **double** `estimateCost` (void) const Estimate the cost of expanding. #### estimateCostByDimension **std::map< vpsc::Dim, double >** `estimateCostByDimension` (void) const Estimate the cost of expanding in each dimension. This method looks at the length of contained segments and reports the sum of shortfalls. #### estimateCostByDimension2 **std::map< vpsc::Dim, double >** `estimateCostByDimension2` (void) const Estimate the cost of expanding in each dimension. This method computes the initial separation constraints in each dimension and reports the sum of their violations. #### estimateCostByDirection **std::map< CardinalDir, double >** `estimateCostByDirection` (void) const Estimate the cost of expanding in each cardinal direction. #### getGoals **ExpansionGoals** `getGoals` (void) Access the expansion goals. #### extendProjSeq **ProjSeq_SP** `extendProjSeq` (ProjSeq_SP ps0) Extend a given projection sequence with those projections necessary to achieve all expansion goals of this manager. ``` -------------------------------- ### Geometric Primitives Source: https://www.adaptagrams.org/documentation/graphs_8h_source Documentation for geometric primitives like BoundingBox and Rectangle. ```APIDOC ## Geometric Primitives ### Bounding Box - **Description**: Represents the bounding box of an object. - **Class**: `dialect::BoundingBox` - **Definition**: graphs.h:68 #### Add Operator - **Description**: Adding two bounding boxes returns the bounding box of their union. - **Method**: `dialect::BoundingBox::operator+=` - **Endpoint**: N/A (Method call) #### Representation - **Description**: Write a simple representation of the bounding box. - **Method**: `dialect::BoundingBox::repr` - **Endpoint**: N/A (Method call) #### Default Constructor - **Description**: Default constructor for BoundingBox. - **Method**: `dialect::BoundingBox::BoundingBox` - **Endpoint**: N/A (Method call) ### Rectangle - **Description**: A rectangle represents a fixed-size shape in the diagram that may be moved to prevent overlaps and sa... - **Class**: `vpsc::Rectangle` - **Definition**: rectangle.h:78 ### Dimension - **Description**: Indicates the x- or y-dimension. - **Enum**: `vpsc::Dim` - **Definition**: rectangle.h:41 ``` -------------------------------- ### Get Route Reference in C++ Source: https://www.adaptagrams.org/documentation/connector_8h_source Provides a reference to the internal PolyLine object representing the route. This allows for direct manipulation of the route data. ```cpp PolyLine& routeRef(void); ``` -------------------------------- ### BoundingBox::repr Source: https://www.adaptagrams.org/documentation/structdialect_1_1BoundingBox Returns a string representation of the BoundingBox. ```APIDOC ## BoundingBox::repr ### Description Generates and returns a simple string representation of the bounding box's extents. ### Method GETTER ### Endpoint N/A (Class Member Function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json {} ``` ### Response #### Success Response (200) - **representation** (std::string) - A string describing the bounding box (e.g., "[x_min, x_max] x [y_min, y_max]"). #### Response Example ```json { "representation": "[0.0, 10.0] x [0.0, 5.0]" } ``` ``` -------------------------------- ### Get Maximum Node Degree Source: https://www.adaptagrams.org/documentation/graphs_8h_source Reports the maximum degree among all nodes in the graph. The degree of a node is the number of edges connected to it. ```cpp unsigned dialect::Graph::getMaxDegree(void) const // Reports the maximum degree of any Node in this Graph. ``` -------------------------------- ### chooseBestPlacement: Select Optimal TreePlacement (C++) Source: https://www.adaptagrams.org/documentation/treeplacement_8h_source Selects the most suitable TreePlacement from a collection of alternatives based on provided options. This function operates on a list of TreePlacements. ```cpp dialect::chooseBestPlacement TreePlacement_SP chooseBestPlacement(TreePlacements tps, HolaOpts opts) Choose the best TreePlacement from among a list of alternatives. **Definition:** treeplacement.cpp:95 ``` -------------------------------- ### Get Bounding Box Width Source: https://www.adaptagrams.org/documentation/graphs_8h_source Retrieves the width of a BoundingBox object. This function is part of the BoundingBox class and returns the horizontal extent. ```C++ double w(void) const ``` -------------------------------- ### C++ Node Allocation and Constructors Source: https://www.adaptagrams.org/documentation/graphs_8h_source Provides static factory methods for allocating Node objects with different initializations. It includes constructors for default nodes, nodes with specified dimensions, and nodes with explicit center coordinates and dimensions. These methods are essential for creating and managing nodes within the graph structure. ```cpp static Node_SP allocate(void); static Node_SP allocate(double w, double h); static Node_SP allocate(double cx, double dy, double w, double h); ``` -------------------------------- ### Get Routing Option Status Source: https://www.adaptagrams.org/documentation/router_8h_source Checks the current state of a specified routing option. Returns true if the option is enabled, and false otherwise. ```C++ bool routingOption(const RoutingOption option) const; ```