Bladeren bron

feat地图增加打点功能

lihao1 3 jaren geleden
bovenliggende
commit
489abfe425

+ 107 - 31
cadengine/src/main/java/cn/sagacloud/android/cadengine/FloorScene.kt

@@ -1,5 +1,6 @@
 package cn.sagacloud.android.cadengine
 
+import android.graphics.Color
 import android.graphics.PointF
 import android.util.Log
 import cn.sagacloud.android.cadengine.types.*
@@ -10,8 +11,10 @@ import com.sybotan.base.utils.SHttpUtil
 import com.sybotan.base.utils.SJsonUtil
 import android.text.TextUtils
 import android.util.SizeF
+import android.view.MotionEvent
 import cn.sagacloud.android.cadengine.items.*
 import cn.sagacloud.android.cadengine.test.GraphyFmItem
+import com.sybotan.android.graphy.SMotionEvent
 import com.sybotan.android.graphy.events.SGraphyViewMoveEvent
 import com.sybotan.android.graphy.items.SGraphyClockItem
 import org.greenrobot.eventbus.Subscribe
@@ -23,6 +26,11 @@ import org.greenrobot.eventbus.ThreadMode
  * @author  庞利祥(sybotan@126.com)
  */
 open class FloorScene : SGraphyScene() {
+    //点击事件回调到界面
+    lateinit var topUp: OnSingleTopUp
+    var item: PointItem? = null
+    val point = Point()
+    var canEdit = true
     /** item 数据  */
     var data: FloorData? = null
         set(value) {
@@ -52,6 +60,7 @@ open class FloorScene : SGraphyScene() {
                 wall.isVisible = value
             }
         } // Set isShowWall
+
     /** 是否显示虚拟墙  */
     var isShowVirtualWall: Boolean = true
         set(value) {
@@ -90,27 +99,36 @@ open class FloorScene : SGraphyScene() {
 
     /** 墙 list   */
     val wallList = ArrayList<WallItem>()
+
     /** 虚拟墙 list   */
     val virtualWallList = ArrayList<VirtualWallItem>()
+
     /** 柱子 list   */
     var columnList = ArrayList<ColumnItem>()
+
     /** 空间 list   */
     var spaceList = ArrayList<SpaceItem>()
+
     /** 空间名称 list   */
     val spaceNameList = ArrayList<SpatialCenterItem>()
+
     /** 门 list   */
     var doorList = ArrayList<DoorItem>()
+
     /** 空间 list   */
     var windowList = ArrayList<WindowItem>()
 
+    /** 点 */
+    val pointItemList = java.util.ArrayList<PointItem>()
+
     /**
      *  获取底图压缩文件
      *
      *  @param  url         请求数据文件路径
      *  @param  isGzip      是否为压缩格式
      */
-    fun loadUrl(url: String, isGzip: Boolean = true){
-        Log.e("PLX","url = $url")
+    fun loadUrl(url: String, isGzip: Boolean = true) {
+        Log.e("PLX", "url = $url")
         try {
             val json = if (isGzip) {
                 SHttpUtil.getZipRequest(url)
@@ -127,7 +145,7 @@ open class FloorScene : SGraphyScene() {
         }
     } // Function loadUrl()
 
-    fun loadData(json : FloorData){
+    fun loadData(json: FloorData) {
         try {
 //            SJsonUtil.propertyNamingStrategy = PropertyNamingStrategy.PascalCase
             Log.e("PLX", "json = ${json?.toJson()}")
@@ -139,21 +157,12 @@ open class FloorScene : SGraphyScene() {
     } // Function loadUrl()
 
 
-
-
-
-
-
-
-
-
-
     /**
      *  增添所有底图 item;
      *
      *  @param  data    itemList对象
      */
-    private fun addBaseMapItem(data: FloorData){
+    private fun addBaseMapItem(data: FloorData) {
         if (data.entityList.size < 1) {
             return;
         }
@@ -207,6 +216,13 @@ open class FloorScene : SGraphyScene() {
                 addWindow(window);
             }
         }
+
+        //添加问题点
+        for (item in pointItemList) {
+            item.isVisible = isShowSpace
+            item.zOrder = 100000f
+            addItem(item)
+        }
     } // Function addBaseMapItem()
 
     /**
@@ -214,7 +230,7 @@ open class FloorScene : SGraphyScene() {
      *
      *  @param  column   柱子
      */
-    open fun addColumn(column: Column){
+    open fun addColumn(column: Column) {
         val item = ColumnItem(column)
         item.isVisible = isShowColumn
         columnList.add(item)
@@ -226,7 +242,7 @@ open class FloorScene : SGraphyScene() {
      *
      *  @param  wall   墙
      */
-    open fun addWall(wall: Wall){
+    open fun addWall(wall: Wall) {
         val item = WallItem(wall)
         item.isVisible = isShowWall
         wallList.add(item)
@@ -238,7 +254,7 @@ open class FloorScene : SGraphyScene() {
      *
      *  @param  wall   墙
      */
-    open fun addVirtualWall(wall: VirtualWall){
+    open fun addVirtualWall(wall: VirtualWall) {
         val item = VirtualWallItem(wall)
         item.isVisible = isShowVirtualWall
         virtualWallList.add(item)
@@ -250,9 +266,9 @@ open class FloorScene : SGraphyScene() {
      *
      *  @param  space       空间
      */
-    open fun addSpace(space: Space){
+    open fun addSpace(space: Space) {
         val item = SpaceItem(space)
-        Log.e("打印数据",space.toJson())
+        Log.e("打印数据", space.toJson())
         item.isVisible = isShowSpace
         spaceList.add(item)
         addItem(item)
@@ -263,14 +279,14 @@ open class FloorScene : SGraphyScene() {
      *
      *  @param  space       空间
      */
-    open fun addSpaceName(space: Space){
-            if (space.outLine!=null){
-                val scitem= SpatialCenterItem(space.name!!)
-                scitem.moveTo(PointF(space.location!!.points!![0].x, -space.location!!.points!![0].y))
-                scitem.zOrder= 100f
-                scitem.isVisible = true
-                spaceNameList.add(scitem)
-                this.addItem(scitem)
+    open fun addSpaceName(space: Space) {
+        if (space.outLine != null) {
+            val scitem = SpatialCenterItem(space.name!!)
+            scitem.moveTo(PointF(space.location!!.points!![0].x, -space.location!!.points!![0].y))
+            scitem.zOrder = 100f
+            scitem.isVisible = true
+            spaceNameList.add(scitem)
+            this.addItem(scitem)
 
         }
     } // Function addSpace()
@@ -280,7 +296,7 @@ open class FloorScene : SGraphyScene() {
      *
      *  @param  door        门
      */
-    open fun addDoor(door: Door){
+    open fun addDoor(door: Door) {
         val item = DoorItem(door)
         item.isVisible = isShowSpace
         doorList.add(item)
@@ -288,13 +304,12 @@ open class FloorScene : SGraphyScene() {
     } // Function addWindow()
 
 
-
     /**
      *  添加窗户到 scene 中
      *
      *  @param  window     窗户
      */
-    open fun addWindow(window: Window){
+    open fun addWindow(window: Window) {
         val item = WindowItem(window)
         item.isVisible = isShowSpace
         windowList.add(item)
@@ -328,12 +343,73 @@ open class FloorScene : SGraphyScene() {
      */
     @Subscribe(threadMode = ThreadMode.MAIN)
     fun onMoveEvent(event: SGraphyViewMoveEvent) {
-        Log.e("x",event.x.toString())
-        Log.e("y",event.y.toString())
+        Log.e("x", event.x.toString())
+        Log.e("y", event.y.toString())
 //        mapToScene = this.mapToScene( PointF(this.width/2f,this.height/2f))
 //        if (cadViewMovePointF!=null){
 //            cadViewMovePointF!!.viewMovePointF(mapToScene)
 //        }
     }
 
+    override fun onSingleTapUp(e: SMotionEvent): Boolean {
+        var outSide = false
+        //计算控制点的边界
+        //是否已经拥有该点
+        if (canEdit) {
+            //便利该点所在的空间
+            for (space in spaceList) {
+                val polygonContainsPoint = Lasso.isPolygonContainsPoint(
+                    space.mPoints,
+                    android.graphics.Point(e.x.toInt(), -e.y.toInt())
+                )
+//                if (polygonContainsPoint) {
+                    outSide = true
+                    space.paint.color = Opt.spaceChoseColor
+                    space.outPaint.color = Color.rgb(0xbd, 0xe8, 0xfe)
+                    point.mX = e.x
+                    point.mY = e.y
+                    if (item != null) {
+                        removeItem(item!!)
+                    }
+                    item = PointItem(point, null)
+                    item!!.isVisible = true
+                    item!!.zOrder = 100000f
+                    addItem(item!!)
+//                } else {
+//                    space!!.paint.color = Opt.spaceColor
+//                    space.outPaint.color = Color.rgb(0xff, 0xff, 0xff)
+//                }
+            }
+            if (!outSide) {
+                return true
+            }
+        } else {
+            for (space in spaceList) {
+                val polygonContainsPoint = Lasso.isPolygonContainsPoint(
+                    space.mPoints,
+                    android.graphics.Point(e.x.toInt(), -e.y.toInt())
+                )
+                if (polygonContainsPoint) {
+                    outSide = true
+                    break
+                }
+            }
+            if (!outSide) {
+                return true
+            }
+        }
+        if (topUp != null) {
+            topUp.onSingUp(e.x, e.y)
+        }
+        return super.onSingleTapUp(e)
+    }
+
+    interface OnSingleTopUp {
+        fun onSingUp(x: Float, y: Float)
+    }
+
+    fun setOnSingleTopUp(topUp: OnSingleTopUp) {
+        this.topUp = topUp
+    }
+
 } // Class FloorScene

+ 94 - 0
cadengine/src/main/java/cn/sagacloud/android/cadengine/Lasso.java

@@ -0,0 +1,94 @@
+package cn.sagacloud.android.cadengine;
+
+import android.graphics.Point;
+import android.graphics.PointF;
+import android.util.Log;
+
+import java.util.List;
+
+/**
+ * Created by lihao.
+ * Date: 2021/6/4
+ */
+public class Lasso {
+    // polygon coordinates
+    private float[] mPolyX, mPolyY;
+
+    // number of size in polygon
+    private int mPolySize;
+
+    /**
+     * default constructor
+     *
+     * @param px polygon coordinates X
+     * @param py polygon coordinates Y
+     * @param ps polygon sides count
+     */
+    public Lasso(float[] px, float[] py, int ps) {
+        this.mPolyX = px;
+        this.mPolyY = py;
+        this.mPolySize = ps;
+    }
+
+    /**
+     * constructor
+     *
+     * @param pointFs points list of the lasso
+     */
+    public Lasso(List<PointF> pointFs) {
+        this.mPolySize = pointFs.size();
+        this.mPolyX = new float[this.mPolySize];
+        this.mPolyY = new float[this.mPolySize];
+
+        for (int i = 0; i < this.mPolySize; i++) {
+            this.mPolyX[i] = pointFs.get(i).x;
+            this.mPolyY[i] = pointFs.get(i).y;
+        }
+        Log.d("lasso", "lasso size:" + mPolySize);
+    }
+
+    /**
+     * check if this polygon contains the point.
+     *
+     * @param x point coordinate X
+     * @param y point coordinate Y
+     * @return point is in polygon flag
+     */
+    public boolean contains(float x, float y) {
+        boolean result = false;
+        for (int i = 0, j = mPolySize - 1; i < mPolySize; j = i++) {
+            if ((mPolyY[i] < y && mPolyY[j] >= y)
+                    || (mPolyY[j] < y && mPolyY[i] >= y)) {
+                if (mPolyX[i] + (y - mPolyY[i]) / (mPolyY[j] - mPolyY[i])
+                        * (mPolyX[j] - mPolyX[i]) < x) {
+                    result = !result;
+                }
+            }
+        }
+        return result;
+    }
+
+    public static boolean isPolygonContainsPoint(List<PointF> mPoints, Point point) {
+        int nCross = 0;
+        for (int i = 0; i < mPoints.size(); i++) {
+            PointF p1 = mPoints.get(i);
+            PointF p2 = mPoints.get((i + 1) % mPoints.size());
+            // 取多边形任意一个边,做点point的水平延长线,求解与当前边的交点个数
+            // p1p2是水平线段,要么没有交点,要么有无限个交点
+            if (p1.y == p2.y)
+                continue;
+            // point 在p1p2 底部 --> 无交点
+            if (point.y < Math.min(p1.y, p2.y))
+                continue;
+            // point 在p1p2 顶部 --> 无交点
+            if (point.y >= Math.max(p1.y, p2.y))
+                continue;
+            // 求解 point点水平线与当前p1p2边的交点的 X 坐标
+            double x = (point.y - p1.y) * (p2.x - p1.x) / (p2.y - p1.y) + p1.x;
+            if (x > point.x) // 当x=point.x时,说明point在p1p2线段上
+                nCross++; // 只统计单边交点
+        }
+        // 单边交点为偶数,点在多边形之外 ---
+        return (nCross % 2 == 1);
+    }
+}

+ 88 - 0
cadengine/src/main/java/cn/sagacloud/android/cadengine/items/PointItem.kt

@@ -0,0 +1,88 @@
+package cn.sagacloud.android.cadengine.items
+
+
+import android.graphics.Canvas
+import android.graphics.Color
+import android.graphics.Paint
+import cn.sagacloud.android.cadengine.types.Point
+import com.sybotan.android.graphy.SGraphyItem
+
+/**
+ * Created by lihao.
+ * Date: 2021/6/4
+ */
+class PointItem (val data: Point, parent: SGraphyItem? = null) : SGraphyItem(parent) {
+    /** 新建 画笔 */
+    val mPaint_inner = Paint()
+    val mPaint_center = Paint()
+    val mPaint_outer = Paint()
+    /** 按时 画笔 */
+    val not_overTime_inner = Paint()
+    val not_overTime_outer = Paint()
+    /** 逾期 画笔 */
+    val overTime_inner = Paint()
+    val overTime_outer = Paint()
+    /** 承接查验复核中 */
+    val checkReviewing_inner = Paint()
+    val checkReviewing_outer = Paint()
+    //var defaultScale = 1.0f
+    //var mScale = 1f
+
+    init {
+        /** 按时 */
+        not_overTime_inner.color = Color.parseColor("#ffffff")
+        not_overTime_inner.isAntiAlias = true
+        not_overTime_inner.style = Paint.Style.FILL
+
+        not_overTime_outer.color = Color.parseColor("#04df97")//绿色
+        not_overTime_outer.isAntiAlias = true
+        not_overTime_outer.style = Paint.Style.FILL
+
+        /** 逾期 */
+        overTime_inner.color = Color.parseColor("#ffffff")
+        overTime_inner.isAntiAlias = true
+        overTime_inner.style = Paint.Style.FILL
+
+        overTime_outer.color = Color.parseColor("#ff3b33")//红色
+        overTime_outer.isAntiAlias = true
+        overTime_outer.style = Paint.Style.FILL
+
+        /** 承接查验复核中 */
+        checkReviewing_inner.color = Color.parseColor("#ffffff")
+        checkReviewing_inner.isAntiAlias = true
+        checkReviewing_inner.style = Paint.Style.FILL
+
+        checkReviewing_outer.color = Color.parseColor("#F7B500")//黄色
+        checkReviewing_outer.isAntiAlias = true
+        checkReviewing_outer.style = Paint.Style.FILL
+
+        /** 新建 */
+        //中圈
+        mPaint_center.color = Color.parseColor("#ffffff")
+        mPaint_center.isAntiAlias = true
+        mPaint_center.style = Paint.Style.FILL
+        //内圈
+        mPaint_inner.color = Color.parseColor("#0c90eb")
+        mPaint_inner.isAntiAlias = true
+        mPaint_inner.style = Paint.Style.FILL
+        //外圈
+        mPaint_outer.color = Color.parseColor("#260c90eb")
+        mPaint_outer.isAntiAlias = true
+        mPaint_outer.style = Paint.Style.FILL
+    }
+
+    /**
+     * Item绘制操作
+     *
+     * @param   canvas          画布
+     * @param   rect            绘制区域
+     */
+    override fun onDraw(canvas: Canvas) {
+        data.scalePoint = scene!!.view!!.defaultPointScale / scene!!.view!!.scale
+        canvas.drawCircle(data.mX, data.mY, 2400f * data.scalePoint, mPaint_outer)
+        canvas.drawCircle(data.mX, data.mY, 1200f * data.scalePoint, mPaint_center)
+        canvas.drawCircle(data.mX, data.mY, 600f * data.scalePoint, mPaint_inner)
+        super.onDraw(canvas)
+    } // Function onDraw()
+
+}

+ 9 - 1
cadengine/src/main/java/cn/sagacloud/android/cadengine/items/SpaceItem.kt

@@ -12,7 +12,7 @@ import com.sybotan.android.graphy.SGraphyItem
  */
 class SpaceItem(private val data: Space, parent: SGraphyItem? = null) : SGraphyItem(parent) {
     /** 画笔 */
-    private val paint = Paint()
+    val paint = Paint()
     /** 墙轮廓 */
     private var spacePath: Path? = null
     /** 空间轮廓线坐标list  */
@@ -25,6 +25,8 @@ class SpaceItem(private val data: Space, parent: SGraphyItem? = null) : SGraphyI
     private var minY = 0f
     /** Y坐标最大值  */
     private var maxY = 0f
+    val outPaint = Paint()
+    var mPoints = ArrayList<PointF>()
 
     init {
         try {
@@ -97,6 +99,10 @@ class SpaceItem(private val data: Space, parent: SGraphyItem? = null) : SGraphyI
 //                return tempArr
 //            })
         //}
+
+        outPaint.style = Paint.Style.STROKE
+        outPaint.color = Color.rgb(0xff, 0xff, 0xff)
+        outPaint.strokeWidth = 20f
     } // Constructor
 
     /**
@@ -161,6 +167,8 @@ class SpaceItem(private val data: Space, parent: SGraphyItem? = null) : SGraphyI
             paint.color = Opt.spaceColor;
             canvas.drawPath(spacePath!!, paint)
 
+
+            canvas.drawPath(spacePath!!, outPaint)
         }
     } // Function onDraw()
 

+ 14 - 0
cadengine/src/main/java/cn/sagacloud/android/cadengine/types/Point.kt

@@ -0,0 +1,14 @@
+package cn.sagacloud.android.cadengine.types
+
+/**
+ * Created by lihao.
+ * Date: 2021/6/4
+ */
+class Point {
+    /** X坐标  */
+    var mX = 0f
+    /** Y坐标  */
+    var mY = 0f
+
+    var scalePoint = 1.0f
+}

+ 17 - 23
demo/src/main/java/com/sybotan/android/demo/activities/GraphyActivity.kt

@@ -29,6 +29,7 @@ import android.support.v7.app.AppCompatActivity
 import android.os.Bundle
 import android.util.Log
 import android.util.SizeF
+import android.widget.Toast
 import cn.sagacloud.android.cadengine.FloorScene
 import cn.sagacloud.cadengine.HttpDownloadMap
 import com.fasterxml.jackson.databind.PropertyNamingStrategy
@@ -52,7 +53,11 @@ class GraphyActivity : AppCompatActivity() {
     }
 
     val scene = FloorScene()
-    val path = "base/cbde057b91e711eb9901557a780001bf.jsonz"
+
+    //    val path = "base/cbde057b91e711eb9901557a780001bf.jsonz"
+//    val path = "base/ebd53bb00d3511eb9a1db95f725712e8.jsonz"
+    val path = "base/a4e671ec8b8111eb9a520dc30d098a92.jsonz"
+//    val path = "base/0764ad79555d11ebab557bd2e22cfb56.jsonz"
 
     @Subscribe
     fun test(msg: SGraphyViewMoveEvent) {
@@ -82,32 +87,11 @@ class GraphyActivity : AppCompatActivity() {
             if (downloadGZIPMap != null) {
                 scene.loadData(downloadGZIPMap!!)
             }
-//            val graphyFmItem = GraphyFmItem()
-//            graphyFmItem.show()
-//            graphyFmItem.isVisible = true
-//            graphyFmItem.moveTo(300f,300f)
-////            graphyFmItem.rotate = 60f // (20f*Math.PI / 180f) as Float
-////            graphyFmItem.isTransform = false
-//            scene.addItem(graphyFmItem)
-//            val graphyTwoItem = GraphyTwoItem()
-//            graphyTwoItem.parent = graphyFmItem
-//            //graphyTwoItem.scale = PointF(2.0f,2.0f)
-////            graphyTwoItem.rotate = 60f
-//            Log.e("children" ,graphyFmItem.children.size.toString())
-////            graphyTwoItem.show()
-////            graphyTwoItem.flag = true
-////            graphyTwoItem.parent = graphyFmItem
-//            graphyTwoItem.moveTo(100f,100f)
-//            graphyTwoItem.color = Color.RED
-
-
-//            scene.addItem(graphyTwoItem)
             /** 主线程处理ui */
             uiThread {
-
-
                 /** 适应屏幕大小 */
                 graphyView.fitSceneToView()
+                graphyView.defaultScale = graphyView.scale
                 /** 限定移动范围不超出屏幕 */
 //                graphyView.moveRange()
                 graphyView.post {
@@ -117,6 +101,16 @@ class GraphyActivity : AppCompatActivity() {
                 Log.e("viewH", graphyView.measuredHeight.toString())
             }
         }
+        nfc.setOnClickListener { Toast.makeText(this, "正在开发中,敬请期待", Toast.LENGTH_SHORT).show() }
+        modelCheckBox.setOnCheckedChangeListener { buttonView, isChecked ->
+            if (isChecked) {
+                modelSubmit.isEnabled = true
+                modelSubmit.alpha = 1f
+            } else {
+                modelSubmit.isEnabled = false
+                modelSubmit.alpha = 0.3f
+            }
+        }
 
         return
     } // Function onCreate()

+ 2 - 1
demo/src/main/java/com/sybotan/android/demo/tools/Opt.kt

@@ -32,7 +32,8 @@ object Opt {
 
 
 
-    val SERVICE_PATH_IMG = "http://api.sagacloud.cn/dp-auxiliary/image-service/common/"
+//    val SERVICE_PATH_IMG = "http://api.sagacloud.cn/dp-auxiliary/image-service/common/"
+    val SERVICE_PATH_IMG = "http://39.102.40.239/image-service/common/"
 //    val SERVICE_PATH_IMG = "http://api.sagacloud.cn/image-service/common/"
     //http://adm.sagacloud.cn/image-service/common/image_upload?systemId=dataPlatform&secret=9e0891a7a8c8e885&overwrite=true&key=1586081610295.jpg
     /** 上传图片服务器地址 */

+ 10 - 0
demo/src/main/res/drawable/bg_blue_3bacb2.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <corners
+        android:radius="50dp"/>
+    <solid
+        android:color="@color/BgBlue_3BACB2"/>
+
+</shape>

+ 7 - 0
demo/src/main/res/drawable/bg_red_f76b65.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <stroke android:color="@color/red_F76B65" android:width="2dp"/>
+    <solid android:color="@color/red_F76B65" />
+    <corners android:radius="50dp" />
+</shape>

+ 94 - 11
demo/src/main/res/layout/activity_graphy.xml

@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
+<?xml version="1.0" encoding="utf-8"?><!--
   ~ *********************************************************************************************************************
   ~
   ~               iFHS7.
@@ -22,15 +21,99 @@
   ~ *********************************************************************************************************************
   -->
 
-<LinearLayout
-        xmlns:android="http://schemas.android.com/apk/res/android"
-        xmlns:tools="http://schemas.android.com/tools"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        tools:context="com.sybotan.android.demo.activities.GraphyActivity">
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical"
+    tools:context="com.sybotan.android.demo.activities.GraphyActivity">
 
     <com.sybotan.android.graphy.SGraphyView
-            android:id="@+id/graphyView"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"/>
+        android:id="@+id/graphyView"
+        android:layout_width="match_parent"
+        android:layout_height="0dp"
+        android:layout_weight="1"
+        android:layout_marginBottom="5dp"/>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="5dp"
+        android:layout_marginBottom="20dp"
+        android:orientation="vertical">
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center_horizontal"
+            android:background="@drawable/bg_red_f76b65"
+            android:paddingLeft="15dp"
+            android:paddingTop="10dp"
+            android:paddingRight="15dp"
+            android:paddingBottom="10dp"
+            android:text="记录空间问题"
+            android:textColor="@color/white"
+            android:textSize="15sp" />
+
+        <LinearLayout
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center_horizontal"
+            android:layout_marginTop="12dp"
+            android:orientation="horizontal">
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_gravity="center_horizontal"
+                android:background="@drawable/bg_blue_3bacb2"
+                android:paddingLeft="15dp"
+                android:paddingTop="10dp"
+                android:paddingRight="15dp"
+                android:paddingBottom="10dp"
+                android:text="绑定二维码"
+                android:textColor="@color/white"
+                android:textSize="15sp" />
+
+            <TextView
+                android:id="@+id/nfc"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_gravity="center_horizontal"
+                android:layout_marginLeft="40dp"
+                android:background="@drawable/bg_blue_3bacb2"
+                android:paddingLeft="15dp"
+                android:paddingTop="10dp"
+                android:paddingRight="15dp"
+                android:paddingBottom="10dp"
+                android:text="绑定NFC标签"
+                android:textColor="@color/white"
+                android:textSize="15sp" />
+        </LinearLayout>
+
+        <CheckBox
+            android:id="@+id/modelCheckBox"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center_horizontal"
+            android:layout_marginTop="22dp"
+            android:text="此空间核查完毕,模型和现场无区别" />
+
+        <TextView
+            android:id="@+id/modelSubmit"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center_horizontal"
+            android:layout_marginTop="12dp"
+            android:alpha="0.3"
+            android:background="@drawable/bg_blue_3bacb2"
+            android:enabled="false"
+            android:paddingLeft="15dp"
+            android:paddingTop="10dp"
+            android:paddingRight="15dp"
+            android:paddingBottom="10dp"
+            android:text="核查完成"
+            android:textColor="@color/white"
+            android:textSize="15sp" />
+    </LinearLayout>
 </LinearLayout>

+ 3 - 0
demo/src/main/res/values/colors.xml

@@ -26,4 +26,7 @@
     <color name="colorPrimary">#3F51B5</color>
     <color name="colorPrimaryDark">#303F9F</color>
     <color name="colorAccent">#FF4081</color>
+    <color name="black_272727">#272727</color>
+    <color name="red_F76B65">#F76B65</color>
+    <color name="BgBlue_3BACB2">#3BACB2</color>
 </resources>

+ 4 - 0
sybotan-android-graphy/src/main/java/com/sybotan/android/graphy/SGraphyView.kt

@@ -76,6 +76,10 @@ open class SGraphyView(context: Context, attrs: AttributeSet? = null)
             field = value
             moveRange()
         }
+    /** 默认缩放比例,用于指定最小缩放比例*/
+    var defaultScale = 0.0000001f
+    /**点的基数缩放比 */
+    var defaultPointScale = 0.01785718f
     /** 最小缩放比例 */
     var minScale = 0.0000001f
         set(value) {