def _sendMatrix(self): return if self.covise_key == 'No key': return if not hasattr(self.params, 'rotX'): return if self.params.rotX==0.0 and self.params.rotY==0.0 and self.params.rotZ==0.0 and \ self.params.transX==0.0 and self.params.transY==0.0 and self.params.transZ==0.0 and \ self.params.scaleX==0.0 and self.params.scaleY==0.0 and self.params.scaleZ==0.0: return matrix = transformationMatrix(self.params) # transform the bbox and send to children bbox = self.importModule.getBox() bboxVec1 = [bbox.getXMin(), bbox.getYMin(), bbox.getZMin()] bboxVec2 = [bbox.getXMax(), bbox.getYMax(), bbox.getZMax()] if not (self.params.rotX == 0.0 and self.params.rotY == 0.0 and self.params.rotZ == 0.0): mat = numpy.array(matrix[0:3, 0:3]) bboxVec1 = multMatVec(mat, bboxVec1) bboxVec2 = multMatVec(mat, bboxVec2) #sort vecs min/max if bboxVec1[0] > bboxVec2[0]: tmp = bboxVec1[0] bboxVec1[0] = bboxVec2[0] bboxVec2[0] = tmp if bboxVec1[1] > bboxVec2[1]: tmp = bboxVec1[1] bboxVec1[1] = bboxVec2[1] bboxVec2[1] = tmp if bboxVec1[2] > bboxVec2[2]: tmp = bboxVec1[2] bboxVec1[2] = bboxVec2[2] bboxVec2[2] = tmp if not (self.params.transX == 0.0 and self.params.transY == 0.0 and self.params.transZ == 0.0): bboxVec1[0] = bboxVec1[0] + self.params.transX bboxVec2[0] = bboxVec2[0] + self.params.transX bboxVec1[1] = bboxVec1[1] + self.params.transY bboxVec2[1] = bboxVec2[1] + self.params.transY bboxVec1[2] = bboxVec1[2] + self.params.transZ bboxVec2[2] = bboxVec2[2] + self.params.transZ bbox.setXMinMax([bboxVec1[0], bboxVec2[0]]) bbox.setYMinMax([bboxVec1[1], bboxVec2[1]]) bbox.setZMinMax([bboxVec1[2], bboxVec2[2]]) Neg2Gui.theNegMsgHandler().sendBBox(self.key, bbox) # send transformation to COVER msg = coGRObjTransformMsg(self.covise_key, *numpy.reshape(matrix, (16, ))) covise.sendRendMsg(msg.c_str())
def sendTransformation(self): if not self.covise_key=='No key': matrix = transformationMatrix(self.params) # send transformation to COVER self.params.matrix[3] = self.params.transX self.params.matrix[7] = self.params.transY self.params.matrix[11] = self.params.transZ msg = coGRObjTransformMsg(self.covise_key, self.params.matrix[0], self.params.matrix[1], self.params.matrix[2], self.params.matrix[3], self.params.matrix[4], self.params.matrix[5], self.params.matrix[6], self.params.matrix[7], self.params.matrix[8], self.params.matrix[9], self.params.matrix[10], self.params.matrix[11], self.params.matrix[12], self.params.matrix[13], self.params.matrix[14], self.params.matrix[15]) #msg = coGRObjMovedMsg(self.covise_key, self.params.transX, self.params.transY, self.params.transZ, self.params.rotX, self.params.rotY, self.params.rotZ, self.params.rotAngle ) covise.sendRendMsg(msg.c_str()) return True return False
def _sendMatrix(self): return if self.covise_key == 'No key': return if not hasattr( self.params, 'rotX'): return if self.params.rotX==0.0 and self.params.rotY==0.0 and self.params.rotZ==0.0 and \ self.params.transX==0.0 and self.params.transY==0.0 and self.params.transZ==0.0 and \ self.params.scaleX==0.0 and self.params.scaleY==0.0 and self.params.scaleZ==0.0: return matrix = transformationMatrix(self.params) # transform the bbox and send to children bbox = self.importModule.getBox() bboxVec1 = [bbox.getXMin(), bbox.getYMin(), bbox.getZMin()] bboxVec2 = [bbox.getXMax(), bbox.getYMax(), bbox.getZMax()] if not (self.params.rotX==0.0 and self.params.rotY==0.0 and self.params.rotZ==0.0): mat = numpy.array(matrix[0:3,0:3]) bboxVec1 = multMatVec(mat, bboxVec1) bboxVec2 = multMatVec(mat, bboxVec2) #sort vecs min/max if bboxVec1[0] > bboxVec2[0]: tmp = bboxVec1[0] bboxVec1[0] = bboxVec2[0] bboxVec2[0] = tmp if bboxVec1[1] > bboxVec2[1]: tmp = bboxVec1[1] bboxVec1[1] = bboxVec2[1] bboxVec2[1] = tmp if bboxVec1[2] > bboxVec2[2]: tmp = bboxVec1[2] bboxVec1[2] = bboxVec2[2] bboxVec2[2] = tmp if not (self.params.transX==0.0 and self.params.transY==0.0 and self.params.transZ==0.0): bboxVec1[0] = bboxVec1[0] + self.params.transX bboxVec2[0] = bboxVec2[0] + self.params.transX bboxVec1[1] = bboxVec1[1] + self.params.transY bboxVec2[1] = bboxVec2[1] + self.params.transY bboxVec1[2] = bboxVec1[2] + self.params.transZ bboxVec2[2] = bboxVec2[2] + self.params.transZ bbox.setXMinMax([bboxVec1[0], bboxVec2[0]]) bbox.setYMinMax([bboxVec1[1], bboxVec2[1]]) bbox.setZMinMax([bboxVec1[2], bboxVec2[2]]) Neg2Gui.theNegMsgHandler().sendBBox(self.key, bbox) # send transformation to COVER msg = coGRObjTransformMsg(self.covise_key, *numpy.reshape(matrix, (16,))) covise.sendRendMsg(msg.c_str())
def sendTransformation(self): if not self.covise_key == 'No key': matrix = transformationMatrix(self.params) # send transformation to COVER self.params.matrix[3] = self.params.transX self.params.matrix[7] = self.params.transY self.params.matrix[11] = self.params.transZ msg = coGRObjTransformMsg( self.covise_key, self.params.matrix[0], self.params.matrix[1], self.params.matrix[2], self.params.matrix[3], self.params.matrix[4], self.params.matrix[5], self.params.matrix[6], self.params.matrix[7], self.params.matrix[8], self.params.matrix[9], self.params.matrix[10], self.params.matrix[11], self.params.matrix[12], self.params.matrix[13], self.params.matrix[14], self.params.matrix[15]) #msg = coGRObjMovedMsg(self.covise_key, self.params.transX, self.params.transY, self.params.transZ, self.params.rotX, self.params.rotY, self.params.rotZ, self.params.rotAngle ) covise.sendRendMsg(msg.c_str()) return True return False
def _sendMatrix(self): if not hasattr( self.params, 'rotX'): return matrix = transformationMatrix(self.params) msg = coGRObjTransformCaseMsg(self.params.name, *numpy.reshape(matrix, (16,))) covise.sendRendMsg(msg.c_str())
def sendTransform(self): matrix = transformationMatrix(self.params) msg = coGRObjTransformSGItemMsg(self.covise_key, *numpy.reshape(matrix, (16,))) covise.sendRendMsg(msg.c_str())
def sendTransform(self): matrix = transformationMatrix(self.params) msg = coGRObjTransformSGItemMsg(self.covise_key, *numpy.reshape(matrix, (16, ))) covise.sendRendMsg(msg.c_str())