Example #1
0
 def analyze_selection(parameters=None):
     # A) calling ancestor
     if not ImmediateWithMemory.analyze_selection(): return False
     # B) validating
     if len(context.application.cache.nodes) == 0: return False
     # C) passed all tests:
     return True
Example #2
0
 def analyze_selection(parameters=None):
     # A) calling ancestor
     if not ImmediateWithMemory.analyze_selection(parameters): return False
     # B) validating
     if not isinstance(context.application.cache.node, Trajectory): return False
     # C) passed all tests:
     return True
Example #3
0
 def analyze_selection(parameters=None):
     # A) calling ancestor
     if not ImmediateWithMemory.analyze_selection(parameters): return False
     # B) validating
     cache = context.application.cache
     if len(cache.containers_with_children) + len(cache.referents_with_children) == 0: return False
     # C) passed all tests:
     return True
Example #4
0
 def analyze_selection(parameters=None):
     # A) calling ancestor
     if not ImmediateWithMemory.analyze_selection(parameters): return False
     # B) validating
     cache = context.application.cache
     if len(cache.containers_with_children) + len(cache.referents_with_children) == 0: return False
     # C) passed all tests:
     return True
Example #5
0
 def analyze_selection(parameters=None):
     # A) calling ancestor
     if not ImmediateWithMemory.analyze_selection(parameters): return False
     # B) validating
     cache = context.application.cache
     if len(cache.translated_nodes) == 0: return False
     if cache.parent_of_translated_nodes is None: return False
     if cache.some_nodes_fixed: return False
     # C) passed all tests:
     return True
Example #6
0
 def analyze_selection(parameters=None):
     # A) calling ancestor
     if not ImmediateWithMemory.analyze_selection(parameters): return False
     # B) validating
     node = context.application.cache.node
     if not isinstance(node, GLTransformationMixin): return False
     if not isinstance(node.transformation, Rotation): return False
     if node.get_fixed(): return False
     # C) passed all tests:
     return True
Example #7
0
 def analyze_selection(parameters=None):
     # A) calling ancestor
     if not ImmediateWithMemory.analyze_selection(parameters): return False
     # B) validating and initialising
     destination = context.application.cache.drag_destination
     if parameters.child_index != -1: return False
     if not isinstance(destination, Reference): return False
     if not destination.check_target(context.application.cache.node): return False
     # C) passed all tests:
     return True
Example #8
0
 def analyze_selection(parameters=None):
     # A) calling ancestor
     if not ImmediateWithMemory.analyze_selection(parameters): return False
     # B) validating
     cache = context.application.cache
     if len(cache.translated_nodes) == 0: return False
     if cache.parent_of_translated_nodes is None: return False
     if cache.some_nodes_fixed: return False
     # C) passed all tests:
     return True
Example #9
0
 def analyze_selection(parameters=None):
     # A) calling ancestor
     if not ImmediateWithMemory.analyze_selection(parameters): return False
     # B) validating
     node = context.application.cache.node
     if not isinstance(node, GLTransformationMixin): return False
     if not isinstance(node.transformation, Rotation): return False
     if node.get_fixed(): return False
     # C) passed all tests:
     return True
Example #10
0
 def analyze_selection(parameters=None):
     # A) calling ancestor
     if not ImmediateWithMemory.analyze_selection(parameters): return False
     # B) validating
     cache = context.application.cache
     if len(cache.nodes) == 0 or len(cache.nodes) > 2: return False
     for Class in cache.classes:
         if not issubclass(Class, GLFrameBase): return False
     if len(cache.nodes) == 2 and not isinstance(cache.parent, GLContainerMixin): return False
     # C) passed all tests:
     return True
Example #11
0
 def analyze_selection(parameters=None):
     # A) calling ancestor
     if not ImmediateWithMemory.analyze_selection(parameters): return False
     # B) validating and initialising
     destination = context.application.cache.drag_destination
     if not isinstance(destination, ContainerMixin): return False
     for Class in context.application.cache.classes:
         if not destination.check_add(Class): return False
     if context.application.cache.recursive_drag: return False
     # C) passed all tests:
     return True
Example #12
0
 def analyze_selection(parameters=None):
     # A) calling ancestor
     if not ImmediateWithMemory.analyze_selection(parameters): return False
     # B) validating and initialising
     destination = context.application.cache.drag_destination
     if not isinstance(destination, ContainerMixin): return False
     for Class in context.application.cache.classes:
         if not destination.check_add(Class): return False
     if context.application.cache.recursive_drag: return False
     # C) passed all tests:
     return True
Example #13
0
 def analyze_selection(parameters=None):
     # A) calling ancestor
     if not ImmediateWithMemory.analyze_selection(parameters): return False
     # B) validating and initialising
     destination = context.application.cache.drag_destination
     if parameters.child_index != -1: return False
     if not isinstance(destination, Reference): return False
     if not destination.check_target(context.application.cache.node):
         return False
     # C) passed all tests:
     return True
Example #14
0
 def analyze_selection(parameters=None):
     # A) calling ancestor
     if not ImmediateWithMemory.analyze_selection(parameters): return False
     # B) validating
     universe = context.application.model.universe
     if sum(universe.cell.active) == 0: return False
     if hasattr(parameters, "repetitions_a") and not universe.cell.active[0]: return False
     if hasattr(parameters, "repetitions_b") and not universe.cell.active[1]: return False
     if hasattr(parameters, "repetitions_c") and not universe.cell.active[2]: return False
     # C) passed all tests:
     return True
Example #15
0
 def analyze_selection(parameters=None):
     # A) calling ancestor
     if not ImmediateWithMemory.analyze_selection(parameters): return False
     # B) validating
     cache = context.application.cache
     for Class in cache.classes:
         if not issubclass(Class, Spring): return False
     if cache.parent is None: return False
     spring_problem = cache.spring_problem
     if spring_problem is None: return False
     if len(spring_problem.frames) == 0: return False
     # C) passed all tests:
     return True
Example #16
0
 def analyze_selection(parameters=None):
     # A) calling ancestor
     if not ImmediateWithMemory.analyze_selection(parameters): return False
     # B) validating
     cache = context.application.cache
     if len(cache.nodes) == 0 or len(cache.nodes) > 2: return False
     for Class in cache.classes:
         if not issubclass(Class, GLFrameBase): return False
     if len(cache.nodes) == 2 and not isinstance(cache.parent,
                                                 GLContainerMixin):
         return False
     # C) passed all tests:
     return True
Example #17
0
 def analyze_selection(parameters=None):
     # A) calling ancestor
     if not ImmediateWithMemory.analyze_selection(parameters): return False
     # B) validating
     cache = context.application.cache
     for Class in cache.classes:
         if not issubclass(Class, Spring): return False
     if cache.parent is None: return False
     spring_problem = cache.spring_problem
     if spring_problem is None: return False
     if len(spring_problem.frames) == 0: return False
     # C) passed all tests:
     return True
Example #18
0
 def analyze_selection(parameters=None):
     # A) calling ancestor
     if not ImmediateWithMemory.analyze_selection(parameters): return False
     # B) validating
     universe = context.application.model.universe
     if sum(universe.cell.active) == 0: return False
     if hasattr(parameters, "interval_a") and not universe.cell.active[0]:
         return False
     if hasattr(parameters, "interval_b") and not universe.cell.active[1]:
         return False
     if hasattr(parameters, "interval_c") and not universe.cell.active[2]:
         return False
     # C) passed all tests:
     return True
Example #19
0
 def analyze_selection(parameters=None):
     # A) calling ancestor
     if not ImmediateWithMemory.analyze_selection(parameters): return False
     cache = context.application.cache
     if len(cache.nodes) == 1:
         if not isinstance(cache.last, GLTransformationMixin) or \
            not isinstance(cache.last.transformation, Rotation): return False
         if cache.last.get_fixed(): return False
     elif len(cache.nodes) == 2:
         if not ((isinstance(cache.last, GLTransformationMixin) and
                  isinstance(cache.last.transformation, Translation)) or
                 isinstance(cache.last, Vector)): return False
         if not isinstance(cache.next_to_last, GLTransformationMixin) or \
            not isinstance(cache.next_to_last.transformation, Complete): return False
         if cache.last.get_fixed(): return False
     else:
         return False
     if cache.some_nodes_fixed: return False
     # C) passed all tests:
     return True
Example #20
0
 def analyze_selection(parameters=None):
     # A) calling ancestor
     if not ImmediateWithMemory.analyze_selection(parameters): return False
     cache = context.application.cache
     if len(cache.nodes) == 1:
         if not isinstance(cache.last, GLTransformationMixin) or \
            not isinstance(cache.last.transformation, Rotation):
             return False
         if cache.last.get_fixed(): return False
     elif len(cache.nodes) == 2:
         if not ((isinstance(cache.last, GLTransformationMixin)
                  and isinstance(cache.last.transformation, Translation))
                 or isinstance(cache.last, Vector)):
             return False
         if not isinstance(cache.next_to_last, GLTransformationMixin) or \
            not isinstance(cache.next_to_last.transformation, Complete):
             return False
         if cache.last.get_fixed(): return False
     else:
         return False
     if cache.some_nodes_fixed: return False
     # C) passed all tests:
     return True
Example #21
0
 def analyze_selection(parameters=None):
     # A) calling ancestor
     if not ImmediateWithMemory.analyze_selection(parameters): return False
     if not AutoConnectMixin.analyze_selection(): return False
     # C) passed all tests:
     return True
Example #22
0
 def analyze_selection(parameters=None):
     # A) calling ancestor
     if not ImmediateWithMemory.analyze_selection(parameters): return False
     if not AutoConnectMixin.analyze_selection(): return False
     # C) passed all tests:
     return True
Example #23
0
 def analyze_selection(parameters=None):
     if not ImmediateWithMemory.analyze_selection(parameters): return False
     if context.application.model.universe.cell_active.sum() != 2: return False
     return True
Example #24
0
 def analyze_selection(parameters=None):
     if not ImmediateWithMemory.analyze_selection(parameters): return False
     if context.application.model.universe.cell.active.sum() != 2:
         return False
     return True