Changeset 1540 in main for trunk


Ignore:
Timestamp:
07/20/12 14:28:20 (9 years ago)
Author:
zali
Message:

doc:typo

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/openPLM/apps/document3D/classes.py

    r1272 r1540  
    2525class Product(object): 
    2626    """ 
    27     Class used to represent the **arborescense** contained in a :class:`~django.core.files.File` **.stp**.A :class:`.Product` can be simple or an assembly, if it is an assembly in **links** we will guard the information about other :class:`.Product` that compose it. 
    28  
    29  
    30     There are two ways of generating a :class:`.Product`, reading the file **.stp** across the class :class:`.NEW_STEP_Import` ( will refill the attribute **label_reference**  for every :class:`Product`), or reading a file **.arb** related to a :class:`.ArbreFile`   
    31     Therefore there exist two ways of distinguishing the different :class:`.Product`, by means of the attribute **label_reference** if this one is not False , or by means of the combination of attributes  **id** and **doc_id**. 
     27    Class used to represent the **arborescense** contained in a  
     28    :class:`~django.core.files.File` **.stp**.A :class:`.Product` can be  
     29    simple or an assembly, if it is an assembly in **links** we will  
     30    guard the information about other :class:`.Product` that compose it. 
     31 
     32 
     33    There are two ways of generating a :class:`.Product`, reading the file 
     34    **.stp** across the class :class:`.NEW_STEP_Import` ( will refill the  
     35    attribute **label_reference**  for every :class:`Product`), or reading  
     36    a file **.arb** related to a :class:`.ArbreFile`  . 
     37    Therefore there exist two ways of distinguishing the different :class:`.Product`,  
     38    by means of the attribute **label_reference** if this one is not False ,  
     39    or by means of the combination of attributes  **id** and **doc_id**. 
    3240     
    3341     
     
    3644    .. attribute:: links 
    3745              
    38         If the product is an assembly, links stores one or more :class:`.openPLM.apps.document3D.classes.Link` references to the products that compose it    
     46        If the product is an assembly, links stores one or more  
     47        :class:`.openPLM.apps.document3D.classes.Link` references to the products that compose it    
    3948 
    4049 
    4150    .. attribute:: label_reference 
    4251     
    43         When we generate an arborescense using :class:`.NEW_STEP_Import` , here we will store the label that represents the :class:`.Product` ,if we generate the arborescense reading a file **.geo**, this attribute will be **False** 
     52        When we generate an arborescense using :class:`.NEW_STEP_Import` ,  
     53        here we will store the label that represents the :class:`.Product` , 
     54        if we generate the arborescense reading a file **.geo**, this attribute will be **False** 
    4455         
    4556    .. attribute:: name 
    4657     
    47         Name of :class:`.Product` ,if the name is empty and there exists a :class:`.Link` at the :class:`.Product` , we will assign the name of the :class:`.Link` to the :class:`.Product` 
     58        Name of :class:`.Product` ,if the name is empty and there exists a  
     59        :class:`.Link` at the :class:`.Product` , we will assign the name of the 
     60        :class:`.Link` to the :class:`.Product` 
    4861         
    4962    .. attribute:: doc_id 
    5063     
    51         Id of the :class:`.DocumentFile` that contains the :class:`.Product` , in the case of :class:`~django.core.files.File` .stp decomposed them **doc_id** maybe different for every :class:`.Product` of the arborescense     
     64        Id of the :class:`.DocumentFile` that contains the :class:`.Product` ,  
     65        in the case of :class:`~django.core.files.File` .stp decomposed them  
     66        **doc_id** may be different for every :class:`.Product` of the arborescense     
    5267         
    5368    .. attribute:: doc_path 
     
    6176    .. attribute:: geometry 
    6277     
    63         If geometry is True (>=1) then the :class:`.Product` is single (without **links** )  , and his value refers to the index that we will use to recover a :class:`.GeometryFile`           
     78        If geometry is True (>=1) then the :class:`.Product` is single (without **links** )   
     79        , and his value refers to the index that we will use to recover a :class:`.GeometryFile`           
    6480         
    6581    .. attribute:: deep 
     
    107123    def is_decomposed(self): 
    108124        """ 
    109         If it is an assembly and the any :class:`.Product` contents in his **links**  
     125        If it is an assembly and any :class:`.Product` contents in his **links**  
    110126        are defined (**doc_id**) in another :class:`DocumentFile` (**doc_id**) 
    111127        """ 
     
    136152    """ 
    137153     
    138     Class used to represent a :class:`Link` between a :class:`.Product`, a :class:`Link` can have several references, each one with his own name and matrix of transformation. Every :class:`Link` points at a :class:`.Product` 
     154    Class used to represent a :class:`Link` with a :class:`.Product`,  
     155    a :class:`Link` can have several references, each one with his own name and matrix of transformation.  
     156    Every :class:`Link` points at a :class:`.Product` 
    139157 
    140158    :model attributes: 
     
    143161    .. attribute:: names 
    144162     
    145         Name of each instances of the :class:`Link` , if the instance does not have name, he get the name of his :class:`.Product` child  
     163        Name of each instances of the :class:`Link` , if the instance does not have name,  
     164        it gets the name of its :class:`.Product` child  
    146165 
    147166    .. attribute:: locations 
     
    155174    .. attribute:: quantity 
    156175     
    157         Number of instances of the :class:`Link`  (Every instance have a **name** and **location**) 
     176        Number of instances of the :class:`Link`  (each instance has a **name** and **location**) 
    158177         
    159178    .. attribute:: visited 
     
    218237    """  
    219238     
    220     :param arbre: chain of characters formatted (following the criteria of the function :class:`.data_for_product`) that represents an arborescense,It contains necessary information to construct :class:`.Product` and :class:`Link`  
    221  
    222     :param product: Product that represents a arborescense , **ONLY** used in successive recursive calls of the function 
     239    :param arbre: chain of characters formatted (following the criteria of the function  
     240                  :func:`.data_for_product`) that represents an arborescense. It contains necessary  
     241                  information to construct :class:`.Product` and :class:`Link`  
     242 
     243    :param product: Product that represents an arborescense , **ONLY** used in successive  
     244                    recursive calls of the function 
    223245    :type plmobject: :class:`.Product` 
    224     :param product_root: Product that represents a root arborescense , used to determine if the product to generating is already present in the tree  
     246    :param product_root: Product that represents a root arborescense , used to determine if  
     247                         the product to generate is already present in the tree  
    225248    :type plmobject: :class:`.Product` 
    226249    :param deep: depth of **product** in the arborescense 
    227     :param to_update_product_root: Product that represents a node of an arborescense  (sub-brach of arborescense referenced by **product_root**) 
     250    :param to_update_product_root: Product that represents a node of an arborescense   
     251                                   (sub-branch of arborescense referenced by **product_root**) 
    228252    :type plmobject: :class:`.Product` 
    229253         
    230254     
    231255    
    232     The :class:`.Product` generated from a file **.arb ** (The case of this function) have his attribute **label_reference** set to False 
    233      
    234     When we generate an :class:`.Product` using :class:`.NEW_STEP_Import` , the attribute **label_reference** will represents and identify the :class:`.Product` ,  
    235      
    236      
    237     From the information contained in a file **.arb** (**arbre**), it generates the corresponding :class:`Product` 
     256    The :class:`.Product` generated from a file **.arb** (The case of this function) have its attribute **label_reference** set to False. 
     257     
     258    When we generate a :class:`.Product` using :class:`.NEW_STEP_Import` , the attribute **label_reference** will represent and identify the :class:`.Product`. 
     259     
     260     
     261    From the information contained in a file **.arb** (**arbre**), it generates the corresponding :class:`Product`. 
    238262    In case of files STEP decomposed, this information can be distributed in several files **.arb** and due to the  
    239263    nature of the decomposition, a **product** could be generated more than once , to avoid this we use the **product_root**. 
    240264    Whenever we generate a new product we verify that it is not already present in **product_root**,we use **to_update_product_root**  
    241     to support updated **product_root**(**to_update_product_root** is a branch of **product_root**) 
     265    to support updated **product_root** (**to_update_product_root** is a branch of **product_root**) 
    242266     
    243267    Example: 
    244         -If we want to generate a **product** of a single file **.arb** 
    245             tree =Product_from_Arb(json.loads(new_ArbreFile.file.read())) 
    246              
    247              
    248         -If we want to generate a **product** of a single file .arb and link this one like a branch of a certain **product_root_node** of an already existing **product_root** 
    249           
    250             product=Product_from_Arb(json.loads(new_ArbreFile.file.read()),product=False, product_root=product_root, deep=xxx, to_update_product_root=product_root_node) 
     268        - If we want to generate a **product** of a single file **.arb** : 
     269         
     270            .. code-block:: python 
     271             
     272                tree=Product_from_Arb(json.loads(new_ArbreFile.file.read())) 
     273             
     274             
     275        - If we want to generate a **product** of a single file .arb and link this one like a branch  
     276          of a certain **product_root_node** of an already existing **product_root** 
     277           
     278            .. code-block:: python 
     279             
     280                product=Product_from_Arb(json.loads(new_ArbreFile.file.read()),product=False, product_root=product_root, deep=xxx, to_update_product_root=product_root_node) 
    251281              
    252             This method generates the :class:`Link` between **product_root_node** and  **product** ,**BUT** it does not add the occurrences, generally this occurrences are stored in the  
    253             existing  :class:`Location_link` between :class:`Part` 
    254              
    255                 After generating the **product** and the :class:`Link`, we will have to refill the :class:`Link` calling the function :meth:`.add_occurrence` for the :class:`Link`: 
    256                  
     282          This method generates the :class:`Link` between **product_root_node** and  **product** , 
     283          **BUT** it does not add the occurrences, generally this occurrences are stored in the  
     284          existing  :class:`Location_link` between :class:`Part` 
     285             
     286          After generating the **product** and the :class:`Link`, we will have to refill the  
     287          :class:`Link` calling the function :meth:`.add_occurrence` for the :class:`Link`: 
     288           
     289            .. code-block:: python 
     290              
    257291                    for location in locations: 
    258292                        product_root_node.links[-1].add_occurrence(location.name,location) 
     
    289323def generateLink(arbre,product,product_child): 
    290324    """  
    291     :param arbre: chain of characters formatted (following the criteria of the function :class:`.data_for_product`) that represents the different occurrences of a :class:`Link` 
     325    :param arbre: chain of characters formatted (following the criteria of the function :func:`.data_for_product`)  
     326                  that represents the different occurrences of a :class:`Link` 
    292327    :param product: :class:`Product` root of the assembly  
    293328    :param product_child: :class:`Product` child of the assembly  
Note: See TracChangeset for help on using the changeset viewer.