Skip to content
This repository was archived by the owner on Dec 27, 2024. It is now read-only.

Commit 165ea06

Browse files
committed
added comments
1 parent ba844f4 commit 165ea06

File tree

7 files changed

+92
-5
lines changed

7 files changed

+92
-5
lines changed

desktop/graph3d/com/support/constraintlayout/extlib/graph3d/Graph3dPanel.java

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright (C) 2023 The Android Open Source Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
package com.support.constraintlayout.extlib.graph3d;
217

318
import com.support.constraintlayout.extlib.graph3d.objects.AxisBox;
@@ -9,7 +24,9 @@
924
import java.awt.image.BufferedImage;
1025
import java.awt.image.DataBufferInt;
1126

12-
27+
/**
28+
* The JPanel that draws the Scene and handles mouse input
29+
*/
1330
public class Graph3dPanel extends JPanel {
1431

1532
Scene3D mScene3D = new Scene3D();

desktop/graph3d/com/support/constraintlayout/extlib/graph3d/Main.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,26 @@
1+
/*
2+
* Copyright (C) 2023 The Android Open Source Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package com.support.constraintlayout.extlib.graph3d;
218

319
import javax.swing.*;
420

21+
/**
22+
* Simple driver for the Graph3dPanel
23+
*/
524
public class Main {
625
public static void main(String[] args) {
726
JFrame frame = new JFrame("3d Plot");

desktop/graph3d/com/support/constraintlayout/extlib/graph3d/Matrix.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2020 The Android Open Source Project
2+
* Copyright (C) 2023 The Android Open Source Project
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
1515
*/
1616
package com.support.constraintlayout.extlib.graph3d;
1717

18-
1918
import java.text.DecimalFormat;
2019
import java.util.Arrays;
2120

desktop/graph3d/com/support/constraintlayout/extlib/graph3d/Object3D.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,23 @@
1+
/*
2+
* Copyright (C) 2023 The Android Open Source Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package com.support.constraintlayout.extlib.graph3d;
218

319
/**
4-
* This represents 3d Object in this system
20+
* This represents 3d Object in this system.
521
*/
622
public class Object3D {
723
protected float[] vert;

desktop/graph3d/com/support/constraintlayout/extlib/graph3d/Scene3D.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import java.util.Arrays;
2121

2222
/**
23-
* This renders a 3 Dimentional surface of a function.
23+
* This renders 3Dimensional Objects.
2424
*/
2525
public class Scene3D {
2626
private static final String TAG = "SurfaceGen";

desktop/graph3d/com/support/constraintlayout/extlib/graph3d/objects/AxisBox.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,26 @@
1+
/*
2+
* Copyright (C) 2023 The Android Open Source Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
package com.support.constraintlayout.extlib.graph3d.objects;
217

318
import com.support.constraintlayout.extlib.graph3d.Object3D;
419
import com.support.constraintlayout.extlib.graph3d.Scene3D;
520

21+
/**
22+
* Draws box along the axis
23+
*/
624
public class AxisBox extends Object3D {
725
int color = 0xFFFF3233;
826
public AxisBox() {

desktop/graph3d/com/support/constraintlayout/extlib/graph3d/objects/Surface3D.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,25 @@
1+
/*
2+
* Copyright (C) 2023 The Android Open Source Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
package com.support.constraintlayout.extlib.graph3d.objects;
217

318
import com.support.constraintlayout.extlib.graph3d.Object3D;
419

20+
/**
21+
* Plots a surface based on Z = f(X,Y)
22+
*/
523
public class Surface3D extends Object3D {
624
final int SIZE = 100; // the number of point on the side total points = SIZE*SIZE
725
private Function mFunction;

0 commit comments

Comments
 (0)