private static function addNodeConcentratedLoad() { // Prepare Load Point $loadPoint = new \Classes\Utils\AbstractInstance\Point(self::$x1->get(), self::$y1->get(), self::$z1->get()); // Try to find node with necessary coordinates $i = 0; $nodes = array_values(self::$nodes); while ($i < count($nodes) && self::$isFound === FALSE) { $node = $nodes[$i]; // Prepare Node Point $nodePoint = new \Classes\Utils\AbstractInstance\Point($node->getProperty('x')->get(), $node->getProperty('y')->get(), $node->getProperty('z')->get()); // Compare coordinates if (\Classes\Utils\Math\Points::isPointSame($loadPoint, $nodePoint)) { self::$isFound = TRUE; // Make new node load $load = new \Classes\Instance\Load\Node\NodeLoad(); // Set Properties $load->setProperty('value', self::$value1); // Add connection self::$loadTable->setConnection($load->getUin(), $node->getUin(), new \Classes\Factory\Connection\LoadConnection\GlobalCoordinateSystem()); // Add new load to array self::$loads[] = $load; } $i++; } }
private static function addConcentratedCommonMemberLoad($node, $commonMemberLoad, $actualMemberUins) { $isFound = FALSE; // Check if concentrated load is placed on Node or Member if (!is_null(self::$hashTable->getConnection($node->getUIn()))) { // This is nodal load $isFound = TRUE; // Make new node load $load = new \Classes\Instance\Load\Node\NodeLoad(); // Set Properties $load->setProperty('value', self::$value1); // Add connection self::$loadTable->setConnection($load->getUin(), $node->getUin(), new \Classes\Factory\Connection\LoadConnection\GlobalCoordinateSystem()); } else { // This is load on member // Prepare Load Point $loadPoint = new \Classes\Utils\AbstractInstance\Point(self::$x1->get(), self::$y1->get(), self::$z1->get()); // Try to find member with necessary coordinates while ((list($memberUin, $memberEndNumber) = each($actualMemberUins)) && $isFound === FALSE) { $connections = array_keys(self::$hashTable->getConnection($memberUin)); $node1 = self::$nodes[$connections[0]]; $node2 = self::$nodes[$connections[1]]; // Prepare Node Point $node1Point = new \Classes\Utils\AbstractInstance\Point($node1->getProperty('x')->get(), $node1->getProperty('y')->get(), $node1->getProperty('z')->get()); $node2Point = new \Classes\Utils\AbstractInstance\Point($node2->getProperty('x')->get(), $node2->getProperty('y')->get(), $node2->getProperty('z')->get()); // Prepare Line $line = new \Classes\Utils\AbstractInstance\Line($node1Point, $node2Point); // Compare coordinates if (\Classes\Utils\Math\Points::isPointOnLine($loadPoint, $line) == 3) { $isFound = TRUE; // Make new node load $load = new \Classes\Instance\Load\Member\ConcenratedMemberLoad(); $position = new \Classes\Value\FloatValue(\Classes\Utils\Math\Points::twoPointsDistance($node1Point, $loadPoint)); // Set Properties $load->setProperty('value', self::$value1); $load->setProperty('position', $position); // Add connection self::$loadTable->setConnection($load->getUin(), $memberUin, new \Classes\Factory\Connection\LoadConnection\GlobalCoordinateSystem()); } } } // If Load has been found, add properties and add to Model if ($isFound) { self::setLoadProperties($load); } else { self::$notFoundObjects[] = $commonMemberLoad->getUin(); } return $isFound; }