-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathqad_array_cmd.py
More file actions
2162 lines (1795 loc) · 108 KB
/
qad_array_cmd.py
File metadata and controls
2162 lines (1795 loc) · 108 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# -*- coding: utf-8 -*-
"""
/***************************************************************************
QAD Quantum Aided Design plugin
comando ARRAY per copiare serie di oggetti
-------------------
begin : 2016-05-03
copyright : iiiii
email : hhhhh
developers : bbbbb aaaaa ggggg
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
"""
# Import the PyQt and QGIS libraries
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
from qad_array_maptool import *
from qad_generic_cmd import QadCommandClass
from qad_msg import QadMsg
from qad_getpoint import *
from qad_getdist_cmd import QadGetDistClass
from qad_getangle_cmd import QadGetAngleClass
from qad_entsel_cmd import QadEntSelClass
from qad_textwindow import *
from qad_ssget_cmd import QadSSGetClass
from qad_entity import *
from qad_variables import *
import qad_utils
import qad_layer
from qad_dim import *
import qad_array_fun
#===============================================================================
# QadARRAYCommandClassSeriesTypeEnum class.
#===============================================================================
class QadARRAYCommandClassSeriesTypeEnum():
RECTANGLE = 1 # serie rettangolare
PATH = 2 # serie lungo una traiettoria
POLAR = 3 # serie polare
#===============================================================================
# QadARRAYCommandClassPathMethodTypeEnum class.
#===============================================================================
class QadARRAYCommandClassPathMethodTypeEnum():
DIVIDE = 1 # metodo dividi
MEASURE = 2 # metodo misura
#===============================================================================
# QadARRAYCommandClassStepEnum class.
#===============================================================================
class QadARRAYCommandClassStepEnum():
ASK_FOR_SELSET = 0 # richiede il gruppo di selezione ogggetti (deve essere = 0 perchè è l'inizio del comando)
ASK_FOR_ARRAYTYPE = 1 # richiede il tipo di serie
ASK_FOR_ROW_N = 2 # richiede il numero di righe (per rettangolo, traiettoria, polare)
ASK_FOR_ROW_SPACE_OR_TOT = 3 # richiede la distanza tra le righe o il totale (per rettangolo, traiettoria, polare)
ASK_FOR_ROW_SPACE_TOT = 4 # richiede il totale della spaziatura delle righe (per rettangolo, traiettoria)
ASK_FOR_ROW_SPACE_2PT = 5 # richiede il secondo punto per misurare la distanza tra le righe
ASK_FOR_BASE_PT = 6 # richiede il punto base (per rettangolo, traiettoria, polare)
ASK_FOR_MAIN_OPTIONS = 7 # richiede di selezionare un'opzione (per rettangolo, traiettoria, polare)
ASK_FOR_ITEM_N = 8 # richiede il numero di elementi lungo la traiettoria (per traiettoria, polare)
ASK_FOR_ITEM_ROTATION = 9 # richiede se gli elementi devono essere allineati (per traiettoria, polare)
ASK_FOR_DEL_ORIG_OBJS = 10 # richiede se gli elementi originali devono essere cancellati (per rettangolo, traiettoria, polare)
ASK_FOR_BASE_PT_BEFORE_MAIN_OPTIONS = 29 # richiede il punto base prima delle opzioni (per polare)
# RETTANGOLO
ASK_FOR_ANGLE = 11 # richiede l'angolo di rotazione dell'asse delle righe
ASK_FOR_COLUMN_COUNT = 12 # richiede il numero di colonne dall'opzione COUNT
ASK_FOR_COLUMN_N = 13 # richiede il numero di colonne dall'opzione COLUMN
ASK_FOR_COLUMN_SPACE_OR_CELL = 14 # richiede la distanza tra le colonne o l'unità di cella
ASK_FOR_COLUMN_SPACE_2PT = 15 # richiede il secondo punto per misurare la distanza tra le colonne
ASK_FOR_ROW_COUNT = 16 # richiede il numero di righe dall'opzione COUNT
ASK_FOR_ROW_SPACE = 17 # richiede la distanza tra le righe
ASK_FOR_1PT_CELL = 18 # richiede il primo angolo della cella
ASK_FOR_2PT_CELL = 19 # richiede il secondo angolo della cella
ASK_FOR_COLUMN_SPACE_OR_TOT = 20 # richiede la distanza tra le colonne o il totale
ASK_FOR_COLUMN_SPACE_TOT = 21 # richiede il totale della spaziatura delle colonne
# TRAIETTORIA
ASK_FOR_PATH_OBJ = 22 # richiede la selezione dell'oggetto traiettoria
ASK_FOR_PATH_METHOD = 23 # richiede il metodo
ASK_FOR_TAN_DIRECTION = 24 # richiede la selezione della direzione della tangente
ASK_FOR_ITEM_SPACE = 25 # richiede la distanza tra gli elementi
# POLARE
ASK_FOR_CENTER_PT = 26 # richiede la selezione del punto centrale della serie
ASK_FOR_ANGLE_BETWEEN_ITEMS = 27 # richiede la selezione dell'angolo tra gli elementi
ASK_FOR_FULL_ANGLE = 28 # richiede la selezione dell'angolo da riempire
# Classe che gestisce il comando ARRAY
class QadARRAYCommandClass(QadCommandClass):
def instantiateNewCmd(self):
""" istanzia un nuovo comando dello stesso tipo """
return QadARRAYCommandClass(self.plugIn)
def getName(self):
return QadMsg.translate("Command_list", "ARRAY")
def getEnglishName(self):
return "ARRAY"
def connectQAction(self, action):
QObject.connect(action, SIGNAL("triggered()"), self.plugIn.runARRAYCommand)
def getIcon(self):
return QIcon(":/plugins/qad/icons/arrayRect.png")
def getNote(self):
# impostare le note esplicative del comando
return QadMsg.translate("Command_ARRAY", "Creates copies of objects in a regularly spaced rectangular, polar, or path array.")
def __init__(self, plugIn):
QadCommandClass.__init__(self, plugIn)
self.SSGetClass = QadSSGetClass(plugIn)
self.SSGetClass.onlyEditableLayers = True
self.entSelClass = None
self.entitySet = QadEntitySet()
self.defaultValue = None
self.basePt = QgsPoint()
self.arrayType = self.plugIn.lastArrayType_array
self.distanceBetweenRows = None
self.distanceBetweenCols = None
self.itemsRotation = self.plugIn.lastItemsRotation_array
self.delObj = QadVariables.get(QadMsg.translate("Environment variables", "DELOBJ"))
self.delOrigSelSet = False
if self.delObj == QadDELOBJEnum.DELETE_ALL: # Delete all defining geometry
self.delOrigSelSet = True
# serie rettangolare
self.rectangleAngle = self.plugIn.lastRectangleAngle_array
self.rectangleCols = self.plugIn.lastRectangleCols_array
self.rectangleRows = self.plugIn.lastRectangleRows_array
self.firstPt = QgsPoint() # primo punto per misurare la distanza tra righe
# serie traiettoria
self.pathTangentDirection = self.plugIn.lastPathTangentDirection_array
self.pathRows = self.plugIn.lastPathRows_array
self.pathItemsNumber = 1
self.pathLinearObjectList = qad_utils.QadLinearObjectList()
self.pathMethod = QadARRAYCommandClassPathMethodTypeEnum.MEASURE
self.distanceFromStartPt = 0.0 # uso interno quando si imposta il metodo dividi
# serie polare
self.centerPt = QgsPoint()
self.polarItemsNumber = self.plugIn.lastPolarItemsNumber_array
self.polarAngleBetween = self.plugIn.lastPolarAngleBetween_array
self.polarRows = self.plugIn.lastPolarRows_array
self.GetDistClass = None
self.GetAngleClass = None
self.featureCache = [] # lista di (layer, feature)
def __del__(self):
QadCommandClass.__del__(self)
if self.SSGetClass is not None:
del self.SSGetClass
def getPointMapTool(self, drawMode = QadGetPointDrawModeEnum.NONE):
if self.step == QadARRAYCommandClassStepEnum.ASK_FOR_SELSET: # quando si é in fase di selezione entità
return self.SSGetClass.getPointMapTool()
# quando si é in fase di richiesta rotazione
elif self.step == QadARRAYCommandClassStepEnum.ASK_FOR_ANGLE or \
self.step == QadARRAYCommandClassStepEnum.ASK_FOR_TAN_DIRECTION or \
self.step == QadARRAYCommandClassStepEnum.ASK_FOR_ANGLE_BETWEEN_ITEMS or \
self.step == QadARRAYCommandClassStepEnum.ASK_FOR_FULL_ANGLE:
return self.GetAngleClass.getPointMapTool()
# quando si é in fase di richiesta distanza
elif self.step == QadARRAYCommandClassStepEnum.ASK_FOR_COLUMN_SPACE_2PT or \
self.step == QadARRAYCommandClassStepEnum.ASK_FOR_ROW_SPACE_TOT or \
self.step == QadARRAYCommandClassStepEnum.ASK_FOR_COLUMN_SPACE_TOT or \
self.step == QadARRAYCommandClassStepEnum.ASK_FOR_ITEM_SPACE or \
self.step == QadARRAYCommandClassStepEnum.ASK_FOR_ROW_SPACE_2PT:
return self.GetDistClass.getPointMapTool()
else:
if (self.plugIn is not None):
if self.PointMapTool is None:
self.PointMapTool = Qad_array_maptool(self.plugIn)
return self.PointMapTool
else:
return None
def getCurrentContextualMenu(self):
if self.step == QadARRAYCommandClassStepEnum.ASK_FOR_SELSET: # quando si é in fase di selezione entità
return self.SSGetClass.getCurrentContextualMenu()
# quando si é in fase di richiesta rotazione
elif self.step == QadARRAYCommandClassStepEnum.ASK_FOR_ANGLE or \
self.step == QadARRAYCommandClassStepEnum.ASK_FOR_TAN_DIRECTION or \
self.step == QadARRAYCommandClassStepEnum.ASK_FOR_ANGLE_BETWEEN_ITEMS or \
self.step == QadARRAYCommandClassStepEnum.ASK_FOR_FULL_ANGLE:
return self.GetAngleClass.getCurrentContextualMenu()
# quando si é in fase di richiesta distanza
elif self.step == QadARRAYCommandClassStepEnum.ASK_FOR_COLUMN_SPACE_2PT or \
self.step == QadARRAYCommandClassStepEnum.ASK_FOR_ROW_SPACE_TOT or \
self.step == QadARRAYCommandClassStepEnum.ASK_FOR_COLUMN_SPACE_TOT or \
self.step == QadARRAYCommandClassStepEnum.ASK_FOR_ITEM_SPACE or \
self.step == QadARRAYCommandClassStepEnum.ASK_FOR_ROW_SPACE_2PT:
return self.GetDistClass.getCurrentContextualMenu()
else:
return self.contextualMenu
#============================================================================
# updatePointMapToolParams
#============================================================================
def updatePointMapToolParams(self):
self.step = -1 * self.step # trucchetto per prendere il map tool base
self.getPointMapTool().refreshSnapType() # aggiorno lo snapType che può essere variato da altri maptool
self.getPointMapTool().entitySet = self.entitySet
self.getPointMapTool().basePt = self.basePt
self.getPointMapTool().arrayType = self.arrayType
self.getPointMapTool().distanceBetweenRows = self.distanceBetweenRows
self.getPointMapTool().distanceBetweenCols = self.distanceBetweenCols
self.getPointMapTool().itemsRotation = self.itemsRotation
if self.arrayType == QadARRAYCommandClassSeriesTypeEnum.RECTANGLE: # serie rettangolare
self.getPointMapTool().rectangleAngle = self.rectangleAngle
self.getPointMapTool().rectangleCols = self.rectangleCols
self.getPointMapTool().rectangleRows = self.rectangleRows
self.getPointMapTool().firstPt = self.firstPt
self.getPointMapTool().doRectangleArray()
elif self.arrayType == QadARRAYCommandClassSeriesTypeEnum.PATH: # serie traiettoria
self.getPointMapTool().pathTangentDirection = self.pathTangentDirection
self.getPointMapTool().pathRows = self.pathRows
self.getPointMapTool().pathItemsNumber = self.pathItemsNumber
self.getPointMapTool().pathLinearObjectList = self.pathLinearObjectList
self.getPointMapTool().distanceFromStartPt = self.distanceFromStartPt
self.getPointMapTool().doPathArray()
elif self.arrayType == QadARRAYCommandClassSeriesTypeEnum.POLAR: # serie polare
self.getPointMapTool().centerPt = self.centerPt
self.getPointMapTool().polarItemsNumber = self.polarItemsNumber
self.getPointMapTool().polarAngleBetween = self.polarAngleBetween
self.getPointMapTool().polarRows = self.polarRows
self.getPointMapTool().doPolarArray()
self.step = -1 * self.step # trucchetto per prendere il map tool base
#============================================================================
# setEntitySet
#============================================================================
def setEntitySet(self, ss):
self.entitySet.set(ss)
rect = self.entitySet.boundingBox(self.plugIn.canvas.mapSettings().destinationCrs())
self.distanceBetweenRows = rect.height() + (rect.height() / 2) if rect.height() != 0 else 1
self.distanceBetweenCols = rect.width() + (rect.width() / 2) if rect.width() != 0 else 1
center = rect.center()
self.basePt.setX(center.x())
self.basePt.setY(center.y())
#============================================================================
# doRectangleArray
#============================================================================
def doRectangleArray(self):
entity = QadEntity()
# copio entitySet
entitySet = QadEntitySet(self.entitySet)
self.plugIn.beginEditCommand("Feature copied", entitySet.getLayerList())
for layerEntitySet in entitySet.layerEntitySetList:
layer = layerEntitySet.layer
while len(layerEntitySet.featureIds) > 0:
featureId = layerEntitySet.featureIds[0]
f = layerEntitySet.getFeature(featureId)
if f is None:
del layerEntitySet.featureIds[0]
continue
# verifico se l'entità appartiene ad uno stile di quotatura
dimEntity = QadDimStyles.getDimEntity(layer, f.id())
if dimEntity is None:
entity.set(layer, f.id())
if qad_array_fun.arrayRectangleEntity(self.plugIn, entity, self.basePt, self.rectangleRows, self.rectangleCols, \
self.distanceBetweenRows, self.distanceBetweenCols, self.rectangleAngle, self.itemsRotation,
True, None) == False:
self.plugIn.destroyEditCommand()
return
del layerEntitySet.featureIds[0] # la rimuovo da entitySet
else:
if qad_array_fun.arrayRectangleEntity(self.plugIn, dimEntity, self.basePt, self.rectangleRows, self.rectangleCols, \
self.distanceBetweenRows, self.distanceBetweenCols, self.rectangleAngle, self.itemsRotation,
True, None) == False:
self.plugIn.destroyEditCommand()
return
dimEntitySet = dimEntity.getEntitySet()
entitySet.subtract(dimEntitySet) # la rimuovo da entitySet
if self.delOrigSelSet: # se devo rimuovere gli oggetti originali
for layerEntitySet in self.entitySet.layerEntitySetList:
# plugIn, layer, featureIds, refresh
if qad_layer.deleteFeaturesToLayer(self.plugIn, layerEntitySet.layer, \
layerEntitySet.featureIds, False) == False:
self.plugIn.destroyEditCommand()
return
self.plugIn.endEditCommand()
#============================================================================
# doPathArray
#============================================================================
def doPathArray(self):
entity = QadEntity()
# copio entitySet
entitySet = QadEntitySet(self.entitySet)
self.plugIn.beginEditCommand("Feature copied", entitySet.getLayerList())
for layerEntitySet in entitySet.layerEntitySetList:
layer = layerEntitySet.layer
while len(layerEntitySet.featureIds) > 0:
featureId = layerEntitySet.featureIds[0]
# verifico se l'entità appartiene ad uno stile di quotatura
dimEntity = QadDimStyles.getDimEntity(layer, featureId)
f = layerEntitySet.getFeature(featureId)
if f is None:
del layerEntitySet.featureIds[0]
continue
# verifico se l'entità appartiene ad uno stile di quotatura
dimEntity = QadDimStyles.getDimEntity(layer, f.id())
if dimEntity is None:
entity.set(layer, f.id())
if qad_array_fun.arrayPathEntity(self.plugIn, entity, self.basePt, self.pathRows, self.pathItemsNumber, \
self.distanceBetweenRows, self.distanceBetweenCols, self.pathTangentDirection, self.itemsRotation, \
self.pathLinearObjectList, self.distanceFromStartPt, True, None) == False:
self.plugIn.destroyEditCommand()
return
del layerEntitySet.featureIds[0] # la rimuovo da entitySet
else:
if qad_array_fun.arrayPathEntity(self.plugIn, dimEntity, self.basePt, self.pathRows, self.pathItemsNumber, \
self.distanceBetweenRows, self.distanceBetweenCols, self.pathTangentDirection, self.itemsRotation, \
self.pathLinearObjectList, self.distanceFromStartPt, True, None) == False:
self.plugIn.destroyEditCommand()
return
dimEntitySet = dimEntity.getEntitySet()
entitySet.subtract(dimEntitySet) # la rimuovo da entitySet
if self.delOrigSelSet: # se devo rimuovere gli oggetti originali
for layerEntitySet in self.entitySet.layerEntitySetList:
# plugIn, layer, featureIds, refresh
if qad_layer.deleteFeaturesToLayer(self.plugIn, layerEntitySet.layer, \
layerEntitySet.featureIds, False) == False:
self.plugIn.destroyEditCommand()
return
self.plugIn.endEditCommand()
#============================================================================
# doPolarArray
#============================================================================
def doPolarArray(self):
entity = QadEntity()
# copio entitySet
entitySet = QadEntitySet(self.entitySet)
self.plugIn.beginEditCommand("Feature copied", entitySet.getLayerList())
for layerEntitySet in entitySet.layerEntitySetList:
layer = layerEntitySet.layer
while len(layerEntitySet.featureIds) > 0:
featureId = layerEntitySet.featureIds[0]
# verifico se l'entità appartiene ad uno stile di quotatura
dimEntity = QadDimStyles.getDimEntity(layer, featureId)
f = layerEntitySet.getFeature(featureId)
if f is None:
del layerEntitySet.featureIds[0]
continue
# verifico se l'entità appartiene ad uno stile di quotatura
dimEntity = QadDimStyles.getDimEntity(layer, f.id())
if dimEntity is None:
entity.set(layer, f.id())
if qad_array_fun.arrayPolarEntity(self.plugIn, entity, self.basePt, self.centerPt, self.polarItemsNumber, \
self.polarAngleBetween, self.polarRows, self.distanceBetweenRows, self.itemsRotation, \
True, None) == False:
self.plugIn.destroyEditCommand()
return
del layerEntitySet.featureIds[0] # la rimuovo da entitySet
else:
if qad_array_fun.arrayPolarEntity(self.plugIn, dimEntity, self.basePt, self.centerPt, self.polarItemsNumber, \
self.polarAngleBetween, self.polarRows, self.distanceBetweenRows, self.itemsRotation, \
True, None) == False:
self.plugIn.destroyEditCommand()
return
dimEntitySet = dimEntity.getEntitySet()
entitySet.subtract(dimEntitySet) # la rimuovo da entitySet
if self.delOrigSelSet: # se devo rimuovere gli oggetti originali
for layerEntitySet in self.entitySet.layerEntitySetList:
# plugIn, layer, featureIds, refresh
if qad_layer.deleteFeaturesToLayer(self.plugIn, layerEntitySet.layer, \
layerEntitySet.featureIds, False) == False:
self.plugIn.destroyEditCommand()
return
self.plugIn.endEditCommand()
#============================================================================
# setPathLinearObjectList
#============================================================================
def setPathLinearObjectList(self, entity, point):
"""
Setta self.pathLinearObjectList che definisce la traiettoria
"""
geom = self.layerToMapCoordinates(entity.layer, entity.getGeometry())
# ritorna una tupla (<The squared cartesian distance>,
# <minDistPoint>
# <afterVertex>
# <leftOf>)
dummy = qad_utils.closestSegmentWithContext(point, geom)
if dummy[2] is not None:
# ritorna la sotto-geometria al vertice <atVertex> e la sua posizione nella geometria (0-based)
subGeom, atSubGeom = qad_utils.getSubGeomAtVertex(geom, dummy[2])
self.pathLinearObjectList.fromPolyline(subGeom.asPolyline())
return True
else:
return False
#============================================================================
# setDistancesByPathItemNumberOnDivide
#============================================================================
def setDistancesByPathItemNumberOnDivide(self):
# imposta le distanza dall'inizio della traccia e la distanza tra gli elementi
# quando gli elementi devono essere distribuiti uniformemente
self.distanceBetweenCols = self.pathLinearObjectList.length() / (self.pathItemsNumber + 1)
self.distanceFromStartPt = self.distanceBetweenCols
#============================================================================
# setItemNumberByDistanceBetweenColsOnMeasure
#============================================================================
def setItemNumberByDistanceBetweenColsOnMeasure(self):
# imposta le distanza dall'inizio della traccia e il numero di elementi
# quando gli elementi non devono essere distribuiti uniformemente ma a partire dall'inizio della traccia
self.pathItemsNumber = int(self.pathLinearObjectList.length() / self.distanceBetweenCols) + 1
self.distanceFromStartPt = 0.0
#============================================================================
# waitForMainOptions
#============================================================================
def waitForMainOptions(self):
if self.arrayType == QadARRAYCommandClassSeriesTypeEnum.RECTANGLE:
self.waitForRectangleArrayOptions()
elif self.arrayType == QadARRAYCommandClassSeriesTypeEnum.PATH:
self.waitForPathArrayOptions()
elif self.arrayType == QadARRAYCommandClassSeriesTypeEnum.POLAR:
self.waitForPolarArrayOptions()
self.updatePointMapToolParams()
#============================================================================
# waitForArrayType
#============================================================================
def waitForArrayType(self):
self.step = QadARRAYCommandClassStepEnum.ASK_FOR_ARRAYTYPE
# imposto il map tool
self.getPointMapTool().setMode(Qad_array_maptool_ModeEnum.NONE)
keyWords = QadMsg.translate("Command_ARRAY", "Rectangular") + "/" + \
QadMsg.translate("Command_ARRAY", "PAth") + "/" + \
QadMsg.translate("Command_ARRAY", "POlar")
englishKeyWords = "Rectangular" + "/" + "PAth" + "/" + "POlar"
if self.arrayType == QadARRAYCommandClassSeriesTypeEnum.RECTANGLE:
self.defaultValue = QadMsg.translate("Command_ARRAY", "Rectangular")
elif self.arrayType == QadARRAYCommandClassSeriesTypeEnum.PATH:
self.defaultValue = QadMsg.translate("Command_ARRAY", "PAth")
elif self.arrayType == QadARRAYCommandClassSeriesTypeEnum.POLAR:
self.defaultValue = QadMsg.translate("Command_ARRAY", "POlar")
prompt = QadMsg.translate("Command_ARRAY", "Enter array type [{0}] <{1}>: ").format(keyWords, self.defaultValue)
keyWords += "_" + englishKeyWords
# si appresta ad attendere un punto o enter o una parola chiave
# msg, inputType, default, keyWords, nessun controllo
self.waitFor(prompt, \
QadInputTypeEnum.KEYWORDS, \
self.defaultValue, \
keyWords, QadInputModeEnum.NONE)
#============================================================================
# waitForBasePt
#============================================================================
def waitForBasePt(self, nextStep = QadARRAYCommandClassStepEnum.ASK_FOR_BASE_PT):
self.step = nextStep
# imposto il map tool
self.getPointMapTool().setMode(Qad_array_maptool_ModeEnum.ASK_FOR_BASE_PT)
# si appresta ad attendere un punto
self.waitForPoint(QadMsg.translate("Command_ARRAY", "Specify base point: "))
#============================================================================
# waitForItemsNumber
#============================================================================
def waitForItemsNumber(self):
self.step = QadARRAYCommandClassStepEnum.ASK_FOR_ITEM_N
# imposto il map tool
self.getPointMapTool().setMode(Qad_array_maptool_ModeEnum.NONE)
if self.arrayType == QadARRAYCommandClassSeriesTypeEnum.PATH:
keyWords = QadMsg.translate("Command_ARRAY", "Fill entire path")
englishKeyWords = "Fill entire path"
self.defaultValue = self.pathItemsNumber
# si appresta ad attendere un numero intero
prompt = QadMsg.translate("Command_ARRAY", "Number of Items to Array or [{0}] <{1}>: ").format(keyWords, str(self.defaultValue))
keyWords += "_" + englishKeyWords
inputType = QadInputTypeEnum.INT | QadInputTypeEnum.KEYWORDS
elif self.arrayType == QadARRAYCommandClassSeriesTypeEnum.POLAR:
# si appresta ad attendere un numero intero
keyWords = ""
self.defaultValue = self.polarItemsNumber
prompt = QadMsg.translate("Command_ARRAY", "Number of Items to Array <{0}>: ").format(str(self.defaultValue))
inputType = QadInputTypeEnum.INT
# msg, inputType, default, keyWords, valori positivi
self.waitFor(prompt, \
inputType, \
self.defaultValue, \
keyWords, \
QadInputModeEnum.NOT_ZERO | QadInputModeEnum.NOT_NEGATIVE)
#============================================================================
# waitForRows
#============================================================================
def waitForRows(self, nextStep):
self.step = nextStep
# imposto il map tool
self.getPointMapTool().setMode(Qad_array_maptool_ModeEnum.NONE)
# si appresta ad attendere un numero intero
msg = QadMsg.translate("Command_ARRAY", "Specify number of rows <{0}>: ")
if self.arrayType == QadARRAYCommandClassSeriesTypeEnum.RECTANGLE:
self.defaultValue = self.rectangleRows
elif self.arrayType == QadARRAYCommandClassSeriesTypeEnum.PATH:
self.defaultValue = self.pathRows
elif self.arrayType == QadARRAYCommandClassSeriesTypeEnum.POLAR:
self.defaultValue = self.polarRows
prompt = msg.format(str(self.defaultValue))
# msg, inputType, default, keyWords, valori positivi
self.waitFor(prompt, \
QadInputTypeEnum.INT, \
self.defaultValue, \
"", \
QadInputModeEnum.NOT_ZERO | QadInputModeEnum.NOT_NEGATIVE)
#============================================================================
# waitForDistanceBetweenRows
#============================================================================
def waitForDistanceBetweenRows(self, totalOption, nextStep):
self.step = nextStep
self.getPointMapTool().setMode(Qad_array_maptool_ModeEnum.ASK_FOR_ROW_SPACE_FIRST_PT)
self.defaultValue = self.distanceBetweenRows
if self.arrayType == QadARRAYCommandClassSeriesTypeEnum.RECTANGLE:
inputMode = QadInputModeEnum.NOT_ZERO
elif self.arrayType == QadARRAYCommandClassSeriesTypeEnum.PATH:
inputMode = QadInputModeEnum.NOT_ZERO
elif self.arrayType == QadARRAYCommandClassSeriesTypeEnum.POLAR:
inputMode = QadInputModeEnum.NOT_ZERO | QadInputModeEnum.NOT_NEGATIVE
if totalOption:
keyWords = QadMsg.translate("Command_ARRAY", "Total")
englishKeyWords = "Total"
prompt = QadMsg.translate("Command_ARRAY", "Specify distance between rows or [{0}] <{1}>: ").format(keyWords, str(self.defaultValue))
keyWords += "_" + englishKeyWords
inputType = QadInputTypeEnum.FLOAT | QadInputTypeEnum.POINT2D | QadInputTypeEnum.KEYWORDS
else:
prompt = QadMsg.translate("Command_ARRAY", "Specify distance between rows <{0}>: ").format(str(self.defaultValue))
keyWords = ""
inputType = QadInputTypeEnum.FLOAT | QadInputTypeEnum.POINT2D
# si appresta ad attendere un punto, un numero reale o enter o una parola chiave
# msg, inputType, default, keyWords, inputMode
self.waitFor(prompt, \
inputType, \
self.defaultValue, \
keyWords, \
inputMode)
#=========================================================================
# waitForDistanceBetweenRows2Pt
#=========================================================================
def waitForDistanceBetweenRows2Pt(self, startPt):
self.step = QadARRAYCommandClassStepEnum.ASK_FOR_ROW_SPACE_2PT
if self.GetDistClass is not None:
del self.GetDistClass
self.GetDistClass = QadGetDistClass(self.plugIn)
self.GetDistClass.dist = self.distanceBetweenRows
self.GetDistClass.inputMode = QadInputModeEnum.NOT_ZERO
self.GetDistClass.startPt = startPt
self.GetDistClass.run()
#============================================================================
# waitForTotalDistanceRows
#============================================================================
def waitForTotalDistanceRows(self):
self.step = QadARRAYCommandClassStepEnum.ASK_FOR_ROW_SPACE_TOT
if self.arrayType == QadARRAYCommandClassSeriesTypeEnum.RECTANGLE:
default = self.rectangleRows * self.distanceBetweenRows
inputMode = QadInputModeEnum.NOT_ZERO
elif self.arrayType == QadARRAYCommandClassSeriesTypeEnum.PATH:
default = self.pathRows * self.distanceBetweenRows
inputMode = QadInputModeEnum.NOT_ZERO
elif self.arrayType == QadARRAYCommandClassSeriesTypeEnum.POLAR:
default = self.polarRows * self.distanceBetweenRows
inputMode = QadInputModeEnum.NOT_ZERO | QadInputModeEnum.NOT_NEGATIVE
if self.GetDistClass is not None:
del self.GetDistClass
self.GetDistClass = QadGetDistClass(self.plugIn)
prompt = QadMsg.translate("Command_ARRAY", "Specifies the total distance between the start and end row <{0}>: ")
self.GetDistClass.msg = prompt.format(str(default))
self.GetDistClass.dist = default
self.GetDistClass.inputMode = inputMode
self.GetDistClass.run()
#============================================================================
# waitForDelOrigObjs
#============================================================================
def waitForDelOrigObjs(self):
self.step = QadARRAYCommandClassStepEnum.ASK_FOR_DEL_ORIG_OBJS
# imposto il map tool
self.getPointMapTool().setMode(Qad_array_maptool_ModeEnum.NONE)
keyWords = QadMsg.translate("QAD", "Yes") + "/" + QadMsg.translate("QAD", "No")
self.defaultValue = QadMsg.translate("QAD", "Yes")
prompt = QadMsg.translate("Command_ARRAY", "Delete source objects of the array ? [{0}] <{1}>: ").format(keyWords, self.defaultValue)
englishKeyWords = "Yes" + "/" + "No"
keyWords += "_" + englishKeyWords
# msg, inputType, default, keyWords, nessun controllo
self.waitFor(prompt, \
QadInputTypeEnum.KEYWORDS, \
self.defaultValue, \
keyWords, QadInputModeEnum.NONE)
#============================================================================
# waitForItemsRotation
#============================================================================
def waitForItemsRotation(self):
self.step = QadARRAYCommandClassStepEnum.ASK_FOR_ITEM_ROTATION
# imposto il map tool
self.getPointMapTool().setMode(Qad_array_maptool_ModeEnum.NONE)
keyWords = QadMsg.translate("QAD", "Yes") + "/" + QadMsg.translate("QAD", "No")
if self.itemsRotation:
self.defaultValue = QadMsg.translate("QAD", "Yes")
else:
self.defaultValue = QadMsg.translate("QAD", "No")
if self.arrayType == QadARRAYCommandClassSeriesTypeEnum.RECTANGLE:
prompt = QadMsg.translate("Command_ARRAY", "Rotate objects as they are arrayed ? [{0}] <{1}>: ").format(keyWords, self.defaultValue)
elif self.arrayType == QadARRAYCommandClassSeriesTypeEnum.PATH:
prompt = QadMsg.translate("Command_ARRAY", "Align arrayed items to the path ? [{0}] <{1}>: ").format(keyWords, self.defaultValue)
elif self.arrayType == QadARRAYCommandClassSeriesTypeEnum.POLAR:
prompt = QadMsg.translate("Command_ARRAY", "Rotate objects as they are arrayed ? [{0}] <{1}>: ").format(keyWords, self.defaultValue)
englishKeyWords = "Yes" + "/" + "No"
keyWords += "_" + englishKeyWords
# msg, inputType, default, keyWords, nessun controllo
self.waitFor(prompt, \
QadInputTypeEnum.KEYWORDS, \
self.defaultValue, \
keyWords, QadInputModeEnum.NONE)
#============================================================================
# SERIE RETTANGOLARE - INIZIO
#============================================================================
#============================================================================
# waitForRectangleArrayOptions
#============================================================================
def waitForRectangleArrayOptions(self):
self.step = QadARRAYCommandClassStepEnum.ASK_FOR_MAIN_OPTIONS
# imposto il map tool
self.getPointMapTool().setMode(Qad_array_maptool_ModeEnum.NONE)
keyWords = QadMsg.translate("Command_ARRAY", "Base point") + "/" + \
QadMsg.translate("Command_ARRAY", "Angle") + "/" + \
QadMsg.translate("Command_ARRAY", "COUnt") + "/" + \
QadMsg.translate("Command_ARRAY", "Spacing") + "/" + \
QadMsg.translate("Command_ARRAY", "Columns") + "/" + \
QadMsg.translate("Command_ARRAY", "Rows") + "/" + \
QadMsg.translate("Command_ARRAY", "rotate Items") + "/" + \
QadMsg.translate("Command_ARRAY", "eXit")
englishKeyWords = "Base point" + "/" + "Angle" + "/" + "COUnt" + "/" + "Spacing" + "/" + \
"Columns" + "/" + "Rows" + "/" + "rotate Items" + "/" + "eXit"
self.defaultValue = QadMsg.translate("Command_ARRAY", "eXit")
prompt = QadMsg.translate("Command_ARRAY", "Select an option to edit array or [{0}] <{1}>: ").format(keyWords, self.defaultValue)
keyWords += "_" + englishKeyWords
# si appresta ad attendere un punto o enter o una parola chiave
# msg, inputType, default, keyWords, nessun controllo
self.waitFor(prompt, \
QadInputTypeEnum.POINT2D | QadInputTypeEnum.KEYWORDS, \
self.defaultValue, \
keyWords, QadInputModeEnum.NONE)
#============================================================================
# waitForRectangleAngle
#============================================================================
def waitForRectangleAngle(self):
self.step = QadARRAYCommandClassStepEnum.ASK_FOR_ANGLE
if self.GetAngleClass is not None:
del self.GetAngleClass
# si appresta ad attendere l'angolo di rotazione
self.GetAngleClass = QadGetAngleClass(self.plugIn)
prompt = QadMsg.translate("Command_ARRAY", "Specify the angle of rotation for the row axis <{0}>: ")
self.GetAngleClass.msg = prompt.format(str(qad_utils.toDegrees(self.rectangleAngle)))
self.GetAngleClass.angle = self.rectangleAngle
self.GetAngleClass.run()
return False
#============================================================================
# waitForRectangleColumns
#============================================================================
def waitForRectangleColumns(self, nextStep):
self.step = nextStep
# imposto il map tool
self.getPointMapTool().setMode(Qad_array_maptool_ModeEnum.NONE)
# optionFrom può essere ASK_FOR_COLUMN_COUNT o ASK_FOR_COLUMN_N
self.defaultValue = self.rectangleCols
# si appresta ad attendere un numero intero
msg = QadMsg.translate("Command_ARRAY", "Specify number of columns <{0}>: ")
# msg, inputType, default, keyWords, valori positivi
self.waitFor(msg.format(str(self.defaultValue)), \
QadInputTypeEnum.INT, \
self.defaultValue, \
"", \
QadInputModeEnum.NOT_ZERO | QadInputModeEnum.NOT_NEGATIVE)
#============================================================================
# waitForRectangleColumnsSpacing
#============================================================================
def waitForRectangleColumnsSpacing(self):
self.step = QadARRAYCommandClassStepEnum.ASK_FOR_COLUMN_SPACE_OR_CELL
# imposto il map tool
self.getPointMapTool().setMode(Qad_array_maptool_ModeEnum.ASK_FOR_COLUMN_SPACE_FIRST_PT)
self.defaultValue = self.distanceBetweenCols
keyWords = QadMsg.translate("Command_ARRAY", "Unit cell")
englishKeyWords = "Unit cell"
prompt = QadMsg.translate("Command_ARRAY", "Specify distance between columns or [{0}] <{1}>: ")
prompt = prompt.format(keyWords, str(self.defaultValue))
keyWords += "_" + englishKeyWords
# si appresta ad attendere un punto, un numero reale o enter o una parola chiave
# msg, inputType, default, keyWords, valori positivi
self.waitFor(prompt, \
QadInputTypeEnum.FLOAT | QadInputTypeEnum.POINT2D | QadInputTypeEnum.KEYWORDS, \
self.defaultValue, \
keyWords, \
QadInputModeEnum.NOT_ZERO)
#============================================================================
# waitForRectangleColumnsSpacing2Pt
#============================================================================
def waitForRectangleColumnsSpacing2Pt(self, startPt):
self.step = QadARRAYCommandClassStepEnum.ASK_FOR_COLUMN_SPACE_2PT
if self.GetDistClass is not None:
del self.GetDistClass
self.GetDistClass = QadGetDistClass(self.plugIn)
self.GetDistClass.dist = self.distanceBetweenCols
self.GetDistClass.inputMode = QadInputModeEnum.NOT_ZERO
self.GetDistClass.startPt = startPt
self.GetDistClass.run()
#============================================================================
# waitForRectangleTotalDistanceCols
#============================================================================
def waitForRectangleTotalDistanceCols(self):
self.step = QadARRAYCommandClassStepEnum.ASK_FOR_COLUMN_SPACE_TOT
if self.GetDistClass is not None:
del self.GetDistClass
self.GetDistClass = QadGetDistClass(self.plugIn)
prompt = QadMsg.translate("Command_ARRAY", "Specifies the total distance between the start and end columns <{0}>: ")
default = self.rectangleCols * self.distanceBetweenCols
self.GetDistClass.msg = prompt.format(str(default))
self.GetDistClass.dist = default
self.GetDistClass.inputMode = QadInputModeEnum.NOT_ZERO
self.GetDistClass.run()
#============================================================================
# waitForRectangleDistanceBetweenCols
#============================================================================
def waitForRectangleDistanceBetweenCols(self, totalOption):
self.step = QadARRAYCommandClassStepEnum.ASK_FOR_COLUMN_SPACE_OR_TOT
# imposto il map tool
self.getPointMapTool().setMode(Qad_array_maptool_ModeEnum.ASK_FOR_COLUMN_SPACE_FIRST_PT)
self.defaultValue = self.distanceBetweenCols
if totalOption:
keyWords = QadMsg.translate("Command_ARRAY", "Total")
englishKeyWords = "Total"
prompt = QadMsg.translate("Command_ARRAY", "Specify distance between columns or [{0}] <{1}>: ").format(keyWords, str(self.defaultValue))
keyWords += "_" + englishKeyWords
inputType = QadInputTypeEnum.FLOAT | QadInputTypeEnum.POINT2D | QadInputTypeEnum.KEYWORDS
else:
prompt = QadMsg.translate("Command_ARRAY", "Specify distance between columns <{0}>: ").format(str(self.defaultValue))
keyWords = ""
inputType = QadInputTypeEnum.FLOAT | QadInputTypeEnum.POINT2D
# si appresta ad attendere un punto, un numero reale o enter o una parola chiave
# msg, inputType, default, keyWords, valori positivi
self.waitFor(prompt, \
inputType, \
self.defaultValue, \
keyWords, \
QadInputModeEnum.NOT_ZERO)
#============================================================================
# waitForRectangleFirstCellCorner
#============================================================================
def waitForRectangleFirstCellCorner(self):
self.step = QadARRAYCommandClassStepEnum.ASK_FOR_1PT_CELL
# si appresta ad attendere un punto
self.waitForPoint(QadMsg.translate("Command_ARRAY", "Specify first cell corner: "))
#============================================================================
# waitForRectangleSecondCellCorner
#============================================================================
def waitForRectangleSecondCellCorner(self):
self.step = QadARRAYCommandClassStepEnum.ASK_FOR_2PT_CELL
# imposto il map tool
self.getPointMapTool().firstPt = self.firstPt
self.getPointMapTool().setMode(Qad_array_maptool_ModeEnum.ASK_FOR_2PT_CELL)
# si appresta ad attendere un punto
self.waitForPoint(QadMsg.translate("Command_ARRAY", "Specify second cell corner: "))
#============================================================================
# SERIE RETTANGOLARE - FINE
# SERIE TRAIETTORIA - INIZIO
#============================================================================
#============================================================================
# waitForPathObject
#============================================================================
def waitForPathObject(self, msgMapTool, msg):
if self.entSelClass is not None:
del self.entSelClass
self.step = QadARRAYCommandClassStepEnum.ASK_FOR_PATH_OBJ
self.entSelClass = QadEntSelClass(self.plugIn)
self.entSelClass.msg = QadMsg.translate("Command_ARRAY", "Select the object to use for the path of the array: ")
# scarto la selezione di punti e quote
self.entSelClass.checkPointLayer = False
self.entSelClass.checkLineLayer = True
self.entSelClass.checkPolygonLayer = True
self.entSelClass.checkDimLayers = False
self.entSelClass.run(msgMapTool, msg)
#============================================================================
# waitForPathArrayOptions
#============================================================================
def waitForPathArrayOptions(self):
self.step = QadARRAYCommandClassStepEnum.ASK_FOR_MAIN_OPTIONS
# imposto il map tool
self.getPointMapTool().setMode(Qad_array_maptool_ModeEnum.NONE)
keyWords = QadMsg.translate("Command_ARRAY", "Method") + "/" + \
QadMsg.translate("Command_ARRAY", "Base point") + "/" + \
QadMsg.translate("Command_ARRAY", "Tangent direction") + "/" + \
QadMsg.translate("Command_ARRAY", "Items") + "/" + \
QadMsg.translate("Command_ARRAY", "Rows") + "/" + \
QadMsg.translate("Command_ARRAY", "Align items") + "/" + \
QadMsg.translate("Command_ARRAY", "eXit")
englishKeyWords = "Method" + "/" + "Base point" + "/" + "Tangent direction" + "/" + "Items" + "/" + \
"Rows" + "/" + "Align items" + "/" + "eXit"
self.defaultValue = QadMsg.translate("Command_ARRAY", "eXit")
prompt = QadMsg.translate("Command_ARRAY", "Select an option to edit array or [{0}] <{1}>: ").format(keyWords, self.defaultValue)
keyWords += "_" + englishKeyWords
# si appresta ad attendere un punto o enter o una parola chiave
# msg, inputType, default, keyWords, nessun controllo
self.waitFor(prompt, \
QadInputTypeEnum.POINT2D | QadInputTypeEnum.KEYWORDS, \
self.defaultValue, \
keyWords, QadInputModeEnum.NONE)
#============================================================================
# waitForPathMethod
#============================================================================
def waitForPathMethod(self):
self.step = QadARRAYCommandClassStepEnum.ASK_FOR_PATH_METHOD
keyWords = QadMsg.translate("Command_ARRAY", "Divide") + "/" + QadMsg.translate("Command_ARRAY", "Measure")
if self.pathMethod == QadARRAYCommandClassPathMethodTypeEnum.DIVIDE:
self.defaultValue = QadMsg.translate("Command_ARRAY", "Divide")
elif self.pathMethod == QadARRAYCommandClassPathMethodTypeEnum.MEASURE:
self.defaultValue = QadMsg.translate("Command_ARRAY", "Measure")
prompt = QadMsg.translate("Command_ARRAY", "Specify path method [{0}] <{1}>: ").format(keyWords, self.defaultValue)
englishKeyWords = "Divide" + "/" + "Measure"
keyWords += "_" + englishKeyWords
# si appresta ad attendere enter o una parola chiave
# msg, inputType, default, keyWords, nessun controllo
self.waitFor(prompt, \
QadInputTypeEnum.KEYWORDS, \
self.defaultValue, \
keyWords, QadInputModeEnum.NONE)
#============================================================================
# waitForPathTangentDirection
#============================================================================
def waitForPathTangentDirection(self):
self.step = QadARRAYCommandClassStepEnum.ASK_FOR_TAN_DIRECTION
if self.GetAngleClass is not None:
del self.GetAngleClass
# si appresta ad attendere l'angolo di rotazione
self.GetAngleClass = QadGetAngleClass(self.plugIn)
prompt = QadMsg.translate("Command_ARRAY", "Specify the first point for array tangent direction: ")
self.GetAngleClass.msg = prompt.format(str(qad_utils.toDegrees(self.pathTangentDirection)))
self.GetAngleClass.angle = self.pathTangentDirection
self.GetAngleClass.run()
return False
#============================================================================
# waitForPathDistanceBetweenItems
#============================================================================
def waitForPathDistanceBetweenItems(self):
self.step = QadARRAYCommandClassStepEnum.ASK_FOR_ITEM_SPACE
if self.GetDistClass is not None:
del self.GetDistClass
self.GetDistClass = QadGetDistClass(self.plugIn)
prompt = QadMsg.translate("Command_ARRAY", "Specify distance between items along path <{0}>: ")
self.GetDistClass.msg = prompt.format(str(self.distanceBetweenCols))
self.GetDistClass.dist = self.distanceBetweenCols
self.GetDistClass.inputMode = QadInputModeEnum.NOT_ZERO | QadInputModeEnum.NOT_NEGATIVE
self.GetDistClass.run()