zoukankan      html  css  js  c++  java
  • max 关于面数的脚本,这个在帮助里面还有很多的茶壶什么的 还有面数显示颜色什么的, 有需要时 学习下。

    (


    global
    FaceAreaChecker


    struct
    FaceAreaCheckerStruct


    (


    FaceAreaThresholdMin = 1,


    FaceAreaThresholdMax = 10,


    FaceAreaMode = 1,


    faceAreaDialog = undefined,


    InteractiveUpdates = true,


    iniFileName = (getDir #plugcfg +"\\FaceAreaXViewChecker.ini"),


    resultColors = #(green, blue+green*0.5, red+yellow*0.5, blue,
    yellow, red),


     


    fn
    geomCheck theTime theNode theResults =


    (


    local
    theCount =
    case
    classof theNode
    of


    (


    Editable_Poly: getNumFaces theNode


    Editable_Mesh: theNode.numfaces


    )


    local
    theAreaMethod =
    case
    classof theNode
    of


    (


    Editable_Poly: polyOp.getFaceArea


    Editable_Mesh: meshOp.getFaceArea


    )


     


    for f = 1
    to theCount do


    (


    local
    theArea = theAreaMethod theNode f


    case
    FaceAreaChecker.FaceAreaMode
    of


    (


    default:
    if theArea >=
    FaceAreaChecker.FaceAreaThresholdMin
    and
    theArea <= FaceAreaChecker.FaceAreaThresholdMax
    do append theResults f


    2:
    if theArea <=
    FaceAreaChecker.FaceAreaThresholdMin
    do
    append theResults f


    3:
    if theArea >=
    FaceAreaChecker.FaceAreaThresholdMin
    do
    append theResults f


    4:
    if theArea <=
    FaceAreaChecker.FaceAreaThresholdMax
    do
    append theResults f


    5:
    if theArea >=
    FaceAreaChecker.FaceAreaThresholdMax
    do
    append theResults f


    6:
    if theArea <=
    FaceAreaChecker.FaceAreaThresholdMin
    or
    theArea >= FaceAreaChecker.FaceAreaThresholdMax
    do append theResults f


    )


    )


    3


    ),


     


    fn
    supportedCheck theNode =


    (


    classof
    theNode == Editable_Mesh or classof theNode == Editable_Poly


    ),


     


    fn
    configDlg =


    (


    try
    (destroyDialog FaceAreaChecker.faceAreaDialog)
    catch()


    rollout
    faceAreaDialog "Face Area Checker"


    (


    dropdownlist ddl_FaceAreaMode 150 align:#left
    offset:[-10,-3] items:#(
    "Between Min. and Max","Less Than Min.",
    "Greater Than
    Min."
    ,"Less Than Max.", "Greater Than Max.","Not Between Min. and Max") selection:FaceAreaChecker.FaceAreaMode across:2


    colorpicker clr_resultsColor field10 align:#right
    offset:[7,-3]
    color:FaceAreaChecker.resultColors[FaceAreaChecker.FaceAreaMode]


    spinner
    spn_FaceAreaThresholdMin
    "Min. Threshold:" range:[0,1000000,FaceAreaChecker.FaceAreaThresholdMin]
    offset:[7,-3] type:#worldUnits


    spinner
    spn_FaceAreaThresholdMax
    "Max. Threshold:" range:[0,1000000,FaceAreaChecker.FaceAreaThresholdMax]
    offset:[7,-3] type:#worldUnits


    checkbox
    chk_InteractiveUpdates
    "Interactive" checked:FaceAreaChecker.InteractiveUpdates offset:[0,-3]
    across:2


    button
    btn_selectResults
    "Selection" align:#right 72 height:18 offset:[7,-3]


      


    fn
    updateDisplay =


    (


    if
    FaceAreaChecker.InteractiveUpdates
    do


    (


    XViewChecker.runCheck CurrentTime


    max views
    redraw


    )


    )


    on
    ddl_FaceAreaMode selected itm
    do


    (


    FaceAreaChecker.FaceAreaMode = itm


    updateDisplay()


    clr_resultsColor.color = FaceAreaChecker.resultColors[itm]


    )


    on
    clr_resultsColor changed val
    do


    (


    FaceAreaChecker.resultColors[ddl_FaceAreaMode.selection] =
    val


    updateDisplay()


    )


    on
    chk_InteractiveUpdates changed state
    do


    (


    FaceAreaChecker.InteractiveUpdates = state


    updateDisplay()


    )


    on
    spn_FaceAreaThresholdMin changed val
    do


    (


    FaceAreaChecker.FaceAreaThresholdMin = val


    updateDisplay()


    )


    on
    spn_FaceAreaThresholdMax changed val
    do


    (


    FaceAreaChecker.FaceAreaThresholdMax = val


    updateDisplay()


    )  


    on
    btn_selectResults pressed
    do


    (


    XViewChecker.selectResults CurrentTime


    max views
    redraw


    )


    on
    faceAreaDialog moved pos
    do
    setIniSetting FaceAreaChecker.iniFileName
    "Dialog" "Position" (pos as
    string)


    )--end rollout


     


    local
    thePos = execute (getIniSetting FaceAreaChecker.iniFileName
    "Dialog"
    "Position"
    )


    if classof
    thePos != Point2
    do thePos
    = mouse.screenpos


    createDialog faceAreaDialog 170 82 thePos.x thePos.y


    FaceAreaChecker.faceAreaDialog = faceAreaDialog


    ),


     


    fn
    textOverride =


    (


    case
    FaceAreaChecker.FaceAreaMode
    of


    (


    1:
    "Between
    "
    +FaceAreaChecker.FaceAreaThresholdMin as string +" and "
    +FaceAreaChecker.FaceAreaThresholdMax
    as
    string


    2:
    "Less Than
    "
    +FaceAreaChecker.FaceAreaThresholdMin as string


    3:
    "Greater Than
    "
    +FaceAreaChecker.FaceAreaThresholdMin as string


    4:
    "Less Than
    "
    +FaceAreaChecker.FaceAreaThresholdMax as string


    5:
    "Greater Than
    "+
    FaceAreaChecker.FaceAreaThresholdMax as string


    6:
    "Not Between
    "
    +FaceAreaChecker.FaceAreaThresholdMin as string +" and " +FaceAreaChecker.FaceAreaThresholdMax as string


    )


    ),


     


    fn
    dispOverride theTime theNode theHwnd theResults=


    (


    local
    theColor = FaceAreaChecker.resultColors[FaceAreaChecker.FaceAreaMode]


    XViewChecker.displayResults theColor theTime theNode theHwnd 3
    (
    for o
    in theResults collect o+1)


    )


    )--end struct


     


    try
    (destroyDialog FaceAreaChecker.faceAreaDialog)
    catch()


    FaceAreaChecker = FaceAreaCheckerStruct()


     


    XViewChecker.unRegisterChecker "Face Area Checker"


    XViewChecker.registerChecker FaceAreaChecker.geomCheck
    FaceAreaChecker.supportedCheck #Faces
    "Face Area Checker" FaceAreaChecker.configDlg FaceAreaChecker.textOverride
    FaceAreaChecker.dispOverride


    )--end script

  • 相关阅读:
    Executing a system tool
    arcengine帮助http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/what_s_new_for_developers_at_10_/0001000002zp000000/
    Arcgis10.2中复制后粘贴图标是灰色的,无法粘贴,编辑也打开了,如何解决?
    VB.net X86设置
    elasticsearch5.5.2安装
    破解极验(geetest)验证码
    solidity代码
    2017年保荐代表人胜任能力考试辅导教材 投资银行业务
    投资银行业务过关必做1500题
    《一站到底》题库及答案
  • 原文地址:https://www.cnblogs.com/gaitian00/p/2016920.html
Copyright © 2011-2022 走看看