public static function add($object) { // GET NODES $nodes = array_values(\Classes\Factory\Model\Model::getNodes()); //GET RESTRAINT TABLE $resTable = \Classes\Factory\Model\Model::getRestraintTable(); // RESTRAINT $restraint = new \Classes\Factory\Connection\SixFreedomConnection\RestraintConnection($object->getProperty('fix')->get()); // RESTRAINT POINT $resPoint = new \Classes\Utils\AbstractInstance\Point($object->getProperty('x')->get(), $object->getProperty('y')->get(), $object->getProperty('z')->get()); // TRY TO FIND NODE FOR RESTRAINT'S APPLICATION $isFound = FALSE; $i = 0; while ($isFound === FALSE && $i < count($nodes)) { $node = $nodes[$i]; // NODE POINT $nodePoint = new \Classes\Utils\AbstractInstance\Point($node->getProperty('x')->get(), $node->getProperty('y')->get(), $node->getProperty('z')->get()); if (\Classes\Utils\Math\Points::isPointSame($nodePoint, $resPoint)) { // ADD CONNECTION $resTable->setConnection($node->getUin(), $restraint); $isFound = TRUE; } $i++; } }
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++; } }