- Timestamp:
- 03/07/12 15:11:00 (8 years ago)
- Location:
- branches/3D/openPLM/document3D
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3D/openPLM/document3D/STP_converter_WebGL.py
r852 r855 35 35 from OCC.TopLoc import TopLoc_Location 36 36 from OCC.TDF import * 37 from openPLM.document3D. Mesh import *37 from openPLM.document3D.mesh import * 38 38 from openPLM.document3D.models import * 39 39 """ -
branches/3D/openPLM/document3D/composer.py
r852 r855 27 27 st.GetFreeShapes(lr) 28 28 29 add_labels(product,lr.Value(1),st) 29 add_labels(product,lr.Value(1),st) 30 print "Sale" 30 31 31 32 WS = XSControl_WorkSession() … … 35 36 status = writer.Write(settings.MEDIA_ROOT+"Compuesto.stp") 36 37 37 print 'Finisehd mesh computation in %fs'%(time.time()-init_time)38 38 39 39 40 def add_labels(product,lr,st): 40 41 #/home/linux/openPLM/branches/3D/openPLM/docs/stp/c818eb4e4353e4ceb5f250227ef2c6d2-rqssooy.stp 42 #DocumentFile<53.8394.10.stp, Document<DOC_00082/Document3D/a>> 43 # ... Step File Reading : /home/linux/openPLM/branches/3D/openPLM/docs/stp/c818eb4e4353e4ceb5f250227ef2c6d2-rqssooy.stp 41 44 42 45 print "\n\n\nentra para product : " , product.name ,"\n\n\n" … … 44 47 if link.product.doc_id!= product.doc_id: 45 48 q1=DocumentFile.objects.get(id=link.product.doc_id) 49 print q1 46 50 my_step_importer = NEW_STEP_Import(q1) 47 51 print "Sale 2" 48 52 lr_2= TDF_LabelSequence() 53 print "Sale 2,5" 49 54 my_step_importer.shape_tool.GetFreeShapes(lr_2) 50 add_labels(link.product,lr_2.Value(1),my_step_importer.shape_tool) 55 add_labels(link.product,lr_2.Value(1),my_step_importer.shape_tool) 56 print "sale 3" 51 57 for d in range(link.quantity): 58 init_time = time.time() 59 print "add : ",link.names[d] 52 60 new_label=st.AddComponent(lr,lr_2.Value(1),TopLoc_Location(link.locations[d].Transformation())) 53 61 SetLabelNom(new_label,link.names[d]) 54 62 print 'Finisehd mesh computation of %s in %fs'%(link.names[d],(time.time()-init_time)) 55 63 56 64 -
branches/3D/openPLM/document3D/decomposer.py
r850 r855 33 33 34 34 35 def get_decomposition_possibilities(arbre):36 37 list=[]38 for link in arbre[0].links:39 list.append(link)40 41 return list42 35 43 36 -
branches/3D/openPLM/document3D/tests/views.py
r852 r855 22 22 self.document = Document3DController.create('doc1', 'Document3D', 23 23 'a', self.user, self.DATA) 24 24 25 def update_time(self,data): 26 data.update({u'last_modif_time': [u'%s-%s-%s %s:%s:%s'%(self.document.mtime.year,self.document.mtime.month,self.document.mtime.day,self.document.mtime.hour,self.document.mtime.minute,self.document.mtime.second)], 27 u'last_modif_microseconds' : [u'%s'%self.document.mtime.microsecond] 28 }) 29 25 30 def test_3D_form(self): 26 31 """ … … 34 39 self.assertEqual(response.context["select_stp_form"].as_table(), form.as_table()) 35 40 36 41 def test_view3D_stp_decompose(self): 42 f=open("document3D/data_test/test.stp") 43 myfile = File(f) 44 new_doc_file=self.document.add_file(myfile) 45 self.controller.attach_to_document(self.document.object) 46 data = data1 47 self.update_time(data) 48 self.post(self.base_url+"decompose/"+str(new_doc_file.id)+"/",data) 49 response = self.get(self.document.object.plmobject_url+"3D/") 50 self.assertEqual(len(response.context["file_geometry_js"]), 3) 51 #self.assertEqual(response.context["select_stp_form"].as_table(), form.as_table()) 37 52 38 53 def test_3D_form_post(self): … … 47 62 response_post = self.post(self.document.object.plmobject_url+"3D/", 48 63 data) 49 self.assertEqual(5, len( list(response_post.context["file_geometry_js"])))64 self.assertEqual(5, len(response_post.context["file_geometry_js"])) 50 65 self.assertNotEqual(response_post.context["javascript_arborescense"],False) 51 66 … … 233 248 self.update_time(data) 234 249 reponse_post = self.post(self.base_url+"decompose/"+str(new_doc_file.id)+"/",data) 235 self.assertEqual(reponse_post.context["extra_errors"]," documentfile is locked")250 self.assertEqual(reponse_post.context["extra_errors"],"Documentfile is locked") 236 251 237 252
Note: See TracChangeset
for help on using the changeset viewer.