コード例 #1
0
    def QOCA(self, params):
        """
      QOCA Constraint Template
      NOTE: DO NOT select a POST/PRE action trigger
      Constraints will be added/removed in a logical manner by other mechanisms.
      """
        return  # <--- Remove this if you want to use QOCA

        # Get the high level constraint helper and solver
        from Qoca.atom3constraints.OffsetConstraints import OffsetConstraints
        oc = OffsetConstraints(self.parent.qocaSolver)

        # Constraint only makes sense if there exists 2 objects connected to this link
        if (not (self.in_connections_ and self.out_connections_)): return

        # Get the graphical objects (subclass of graphEntity/graphLink)
        graphicalObjectLink = self.graphObject_
        graphicalObjectSource = self.in_connections_[0].graphObject_
        graphicalObjectTarget = self.out_connections_[0].graphObject_
        objTuple = (graphicalObjectSource, graphicalObjectTarget,
                    graphicalObjectLink)
        """
      Example constraint, see Kernel/QOCA/atom3constraints/OffsetConstraints.py
      For more types of constraints
      """
        oc.LeftExactDistance(objTuple, 20)
        oc.resolve()  # Resolve immediately after creating entity & constraint
コード例 #2
0
 def QOCA(self, params):
    """
    QOCA Constraint Template
    NOTE: DO NOT select a POST/PRE action trigger
    Constraints will be added/removed in a logical manner by other mechanisms.
    """
    return # <--- Remove this if you want to use QOCA
    
    # Get the high level constraint helper and solver
    from Qoca.atom3constraints.OffsetConstraints import OffsetConstraints
    oc = OffsetConstraints(self.parent.qocaSolver)  
    
    # Constraint only makes sense if there exists 2 objects connected to this link
    if(not (self.in_connections_ and self.out_connections_)): return
    
    # Get the graphical objects (subclass of graphEntity/graphLink) 
    graphicalObjectLink = self.graphObject_
    graphicalObjectSource = self.in_connections_[0].graphObject_
    graphicalObjectTarget = self.out_connections_[0].graphObject_
    objTuple = (graphicalObjectSource, graphicalObjectTarget, graphicalObjectLink)
    
    """
    Example constraint, see Kernel/QOCA/atom3constraints/OffsetConstraints.py
    For more types of constraints
    """
    oc.LeftExactDistance(objTuple, 20)
    oc.resolve() # Resolve immediately after creating entity & constraint 
コード例 #3
0
ファイル: SingleThreading.py プロジェクト: OEP/rdis
 def QOCA(self, params):
    """
    QOCA Constraint Template
    NOTE: DO NOT select a POST/PRE action trigger
    Constraints will be added/removed in a logical manner by other mechanisms.
    """
    return # <---- Remove this to use QOCA
    
    """ Get the high level constraint helper and solver """
    from Qoca.atom3constraints.OffsetConstraints import OffsetConstraints
    oc = OffsetConstraints(self.parent.qocaSolver)  
    
    """
    Example constraint, see Kernel/QOCA/atom3constraints/OffsetConstraints.py
    For more types of constraints
    """
    oc.fixedWidth(self.graphObject_, self.graphObject_.sizeX)
    oc.fixedHeight(self.graphObject_, self.graphObject_.sizeY)
コード例 #4
0
 def QOCA(self, params):
     """
   QOCA Constraint Template
   NOTE: DO NOT select a POST/PRE action trigger
   Constraints will be added/removed in a logical manner by other mechanisms.
   """
     return  # <---- Remove this to use QOCA
     """ Get the high level constraint helper and solver """
     from Qoca.atom3constraints.OffsetConstraints import OffsetConstraints
     oc = OffsetConstraints(self.parent.qocaSolver)
     """
   Example constraint, see Kernel/QOCA/atom3constraints/OffsetConstraints.py
   For more types of constraints
   """
     oc.fixedWidth(self.graphObject_, self.graphObject_.sizeX)
     oc.fixedHeight(self.graphObject_, self.graphObject_.sizeY)